Parcourir la source

Add a foladble function for maximum

DricomDragon il y a 5 ans
Parent
commit
bd7bfcc5b4
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      fold.hs

+ 3 - 0
fold.hs

@@ -2,3 +2,6 @@
 
 fsum::Num a => [a] -> a
 fsum = foldl (+) 0
+
+fmax::(Ord a, Num a) => [a] -> a
+fmax = foldl max 0