Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Solution Proposal Functional Programming --Sheet 9 In the following solution, the labels in the definition of the semantics of a simple Haskell program have
 

Summary: Solution Proposal Functional Programming -- Sheet 9
In the following solution, the labels in the definition of the semantics of a simple Haskell program have
been omitted to improve readability.
Exercise 1
Val
#exp 1
## = Val
#let toNat = \x # if x == True then 1 else 0 in toNat y##
= Val
#toNat y#(# + {toNat/lfp f}) where
f(d) = Val #\x # if x == True then 1 else 0#(# + {toNat/d})
= g where
g(e) = Val
#if x == True then 1 else 0# (# + {toNat/d} + {x/e})
| {z }
# 1
=
8 < :
Val
#1## 1 , if Val

  

Source: Ábrahám, Erika - Fachgruppe Informatik, Rheinisch Westfälische Technische Hochschule Aachen (RWTH)

 

Collections: Computer Technologies and Information Sciences