u/jwbuurlagein r/haskell • Recommends
On “GameOfLife”
…alive == 3 = Alive
| otherwise = Dead
where
alive = ...
And you use the comonad instance to update the entire infinite universe (lazily) at once:
evolve :: Universe Cell -> Universe Cell
evolve universe = universe =>> rule
There are some pointers on making these comonads more efficient in the following presentation: link to this video where the motivation is to have 'infinite spreadsheets'.…