Skip to content

Instantly share code, notes, and snippets.

@shigemk2 shigemk2/fold1.hs
Created Feb 4, 2015

What would you like to do?
maximum' :: (Ord a) => [a] -> a
maximum' = foldl1 max
main = do
print $ maximum' [6,1,2,3,4,5]
-- print $ maximum' [] -- ランタイムエラー
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.