ソースを参照

Add a foladble function for maximum

DricomDragon 5 年 前
コミット
bd7bfcc5b4
1 ファイル変更3 行追加0 行削除
  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