Instantly share code, notes, and snippets.

Embed
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