Skip to content

Instantly share code, notes, and snippets.

@naush
Created July 14, 2010 15:09
Show Gist options
  • Save naush/475518 to your computer and use it in GitHub Desktop.
Save naush/475518 to your computer and use it in GitHub Desktop.
-- Map
increment x = x + 1
map increment [1, 2, 3, 4]
-- Map with curry
map (+1) [1, 2, 3, 4]
-- Map with lambda
map (\x = x + 1) [1, 2, 3, 4]
-- Syntactic sugar (list comprehension)
[x + 1 | x <- [1, 2, 3, 4]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment