Pascal's triangle: Difference between revisions
m
→Functional Python: Pruned out three unused primitives
m (→Functional Python: Pruned out three unused primitives) |
|||
Line 4,116:
<lang python>from itertools import (accumulate, chain, islice, starmap)
from operator import (add)
# pascal :: [Int] -> [Int]
def pascal(xs):
return zipWith(
Line 4,176 ⟶ 4,177:
return (q * c) + s + ((q + qr[1]) * c)
return lambda c: lambda s: go(c, s)
Line 4,201 ⟶ 4,192:
v = f(v)
return lambda x: go(x)
|