Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@victorvoid
Last active August 19, 2018 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorvoid/a041fc3f6e0f40f68ae39414933cdf3b to your computer and use it in GitHub Desktop.
Save victorvoid/a041fc3f6e0f40f68ae39414933cdf3b to your computer and use it in GitHub Desktop.
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