Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
map (\n -> n + 1) [1, 2, 3, 4, 5]
-- [2, 3, 4, 5, 6]
filter (\n -> n `mod` 2 == 0) (1 .. 10)
-- [2,4,6,8,10]
foldl (\acc n -> acc <> show n) "" [1,2,3,4,5]
-- "12345"
foldr (+) 0 (1 .. 5)
-- 15
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.