Selaa lähdekoodia

Add a foladble function for maximum

DricomDragon 5 vuotta sitten
vanhempi
commit
bd7bfcc5b4
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  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