Quellcode durchsuchen

Add a foladble function for maximum

DricomDragon vor 5 Jahren
Ursprung
Commit
bd7bfcc5b4
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  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