Created
June 11, 2014 15:35
-
-
Save taku0/0c4e6759df96005b298e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Control.Applicative | |
| part n 1 = [[n]] | |
| part n k = [0..n] >>= \i -> (i:) <$> part (n - i) (k -1) | |
| main :: IO () | |
| main = mapM_ print (part 7 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment