Skip to content

Commit 7b9f40d

Browse files
committed
Set 3b Ex 8: better example
1 parent e967d70 commit 7b9f40d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎exercises/Set3b.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ merge xs ys = todo
142142
-- mymaximum (>) 0 [1,3,2] ==> 3
143143
-- mymaximum (>) 4 [1,3,2] ==> 4 -- initial value was biggest
144144
-- mymaximum (<) 4 [1,3,2] ==> 1 -- note changed biggerThan
145-
-- mymaximum (\xs ys -> length xs > length ys) [] [[1,2],[3]]
146-
-- ==> [1,2]
145+
-- mymaximum (\(a,b) (c,d) -> b > d) ("",0) [("Banana",7),("Mouse",8)]
146+
-- ==> ("Mouse",8)
147147

148148
mymaximum :: (a -> a -> Bool) -> a -> [a] -> a
149149
mymaximum bigger initial xs = todo

0 commit comments

Comments
 (0)