Skip to content

Instantly share code, notes, and snippets.

@danidiaz
Created March 31, 2013 09:55
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 danidiaz/5280168 to your computer and use it in GitHub Desktop.
Save danidiaz/5280168 to your computer and use it in GitHub Desktop.
Nested list comprehensions.
pairs l = [ [(i,j) | j <- l] | i <- l]
pairs' l = do
i <- l
return $ do
j <- l
return (i,j)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment