Skip to content

Instantly share code, notes, and snippets.

@hardentoo
Forked from imeckler/integer_partitions.hs
Created October 12, 2017 01:52
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 hardentoo/bba800a7a5d6ad9d172d34d2d98c9084 to your computer and use it in GitHub Desktop.
Save hardentoo/bba800a7a5d6ad9d172d34d2d98c9084 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