Skip to content

Instantly share code, notes, and snippets.

@imeckler
Created November 21, 2012 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save imeckler/4123307 to your computer and use it in GitHub Desktop.
Save imeckler/4123307 to your computer and use it in GitHub Desktop.
Integer partitions in haskell
ps = [] : map parts [1..]
where parts n = [n] : [x : p | x <- [1..n], p <- ps !! (n - x), x <= head p]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment