Skip to content

Instantly share code, notes, and snippets.

@plaidfinch
Last active January 4, 2016 14:49
Show Gist options
  • Save plaidfinch/8636921 to your computer and use it in GitHub Desktop.
Save plaidfinch/8636921 to your computer and use it in GitHub Desktop.
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 .
takeWhile ((>= 0) . row) .
iterate (go $ above & right) .
goto (0,n) $ pascal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment