Re:Learn you a Haskell: Zippers
by jewbacca on Wednesday November 03, 2010 @06:25PM
(#1866784)
I've had an investigation on the backburner for a while on whether there's a zipper-like structure for representing 2D grids (eg, a game board). I feel like this may be a blind alley, because a grid would have cycles and no inherent ordering. Can anybody shed some light on this?
[ Parent
| on HN ]
Re:Learn you a Haskell: Zippers
by maxtilford on Wednesday November 03, 2010 @07:03PM
(#1866885)
I think this blog post will be relevant: http://blog.sigfpe.com/2006/12/evaluating-cellular-automata-...
Look into Okasaki's "Purely Functional Datastructures" for an example on how to handle cycles. He talks about double ended queues, which can obviously interpreted as a graph with a single cycle.