Set 5a Ex 11: minor fixes in exercise text

This commit is contained in:
Joel Kaasinen
2020-05-15 13:24:51 +03:00
parent 1e05a30fdc
commit 5fa8e01ce6
+2 -2
View File
@@ -239,14 +239,14 @@ fromList :: [(k,v)] -> KeyVals k v
fromList = todo
------------------------------------------------------------------------------
-- Exercise 11: The data type Nat is the so called Peano
-- Ex 11: The data type Nat is the so called Peano
-- representation for natural numbers. Define functions fromNat and
-- toNat that convert natural numbers to Ints and vice versa.
--
-- Examples:
-- fromNat (PlusOne (PlusOne (PlusOne Zero))) ==> 3
-- toNat 3 ==> Just (PlusOne (PlusOne (PlusOne Zero)))
-- toNat (-3) ==> Nothing
-- fromNat (PlusOne (PlusOne (PlusOne Zero))) ==> 3
--
data Nat = Zero | PlusOne Nat