Skip to content

Commit

Permalink
fixed a non-damaging typo
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@736 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Dec 14, 2009
1 parent 3e1716f commit 024fdde
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions topics/exercises/nb3/FoldNB.hs
Expand Up @@ -51,8 +51,8 @@ maxN = foldNB
(\ x -> if x>1 then x-1 else 0)
(id)

eval :: NB -> Int
eval = foldNB
evaln :: NB -> Int
evaln = foldNB
1
0
(\ x y z -> if x/=0 then y else z)
Expand All @@ -61,14 +61,14 @@ eval = foldNB
(\ x -> if x>1 then x-1 else 0)
(\ x -> if x==0 then 1 else 0)

data Answer = Num Int | Bool2 Bool deriving Show
data Answer = Num Int | Bool Bool deriving Show

evalnb :: NB -> Answer
evalnb = foldNB
(Bool2 True)
(Bool2 False)
(\ (Bool2 x) y z -> if x then y else z)
(Bool True)
(Bool False)
(\ (Bool x) y z -> if x then y else z)
(Num 0)
(\ (Num x) -> Num (x+1) )
(\ (Num x) -> if x>1 then (Num (x-1)) else Num 0)
(\ (Num x) -> if x==0 then Bool2 True else Bool2 False)
(\ (Num x) -> if x==0 then Bool True else Bool False)

0 comments on commit 024fdde

Please sign in to comment.