This commit is contained in:
Aaro Koivukangas
2025-12-22 21:00:16 +02:00
parent 5b03b871c1
commit b55b116ec0
+2 -1
View File
@@ -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