Set 3b Ex 8: better example

This commit is contained in:
Joel Kaasinen
2022-11-21 16:50:43 +02:00
parent e967d70d42
commit 7b9f40dafd
+2 -2
View File
@@ -142,8 +142,8 @@ merge xs ys = todo
-- mymaximum (>) 0 [1,3,2] ==> 3
-- mymaximum (>) 4 [1,3,2] ==> 4 -- initial value was biggest
-- mymaximum (<) 4 [1,3,2] ==> 1 -- note changed biggerThan
-- mymaximum (\xs ys -> length xs > length ys) [] [[1,2],[3]]
-- ==> [1,2]
-- mymaximum (\(a,b) (c,d) -> b > d) ("",0) [("Banana",7),("Mouse",8)]
-- ==> ("Mouse",8)
mymaximum :: (a -> a -> Bool) -> a -> [a] -> a
mymaximum bigger initial xs = todo