RosettaCodeData/Task/Partition-function-P/Haskell/partition-function-p-2.hs

3 lines
90 B
Haskell

part = 1 : b 1
where b n = p where p = zipWith (+) (1 : b (n + 1)) (replicate n 0 ++ p)