diff --git a/exercises/Set4b.hs b/exercises/Set4b.hs index ef5fb12..83b640b 100644 --- a/exercises/Set4b.hs +++ b/exercises/Set4b.hs @@ -38,7 +38,8 @@ myMaximum :: [Int] -> Int myMaximum [] = 0 myMaximum (x:xs) = foldr maxHelper x xs -maxHelper = todo +maxHelper :: Int -> Int -> Int +maxHelper x acc = if x > acc then x else acc ------------------------------------------------------------------------------ -- Ex 3: compute the sum and length of a list with a fold. Define