Skip to content

Instantly share code, notes, and snippets.

View plaidfinch's full-sized avatar

finch plaidfinch

View GitHub Profile
pascal :: Z2 Int Int Integer
pascal = evaluate $ sheet (0,0) 0 $
repeat 1 : repeat (1 : pascalRow)
where pascalRow = repeat $ cell above + cell left
pascalLists :: [[Integer]]
pascalLists = map pascalList [0..]
where
pascalList n =
map view .
evaluate :: ComonadApply f => f (f b -> b) -> f b
evaluate fs = fix $ (fs <@>) . duplicate