LYAH is great. For those who are interested, there is a library, 'syz' (Scrap Your Zippers), which provides a generic zipper for any data type, even mutually-recursive types:
Its internals are pretty interesting if you've ever thought about implementing a generic zipper structure. For example it uses Typeable to reify the focus type.
I'm finishing up my own generic zipper library which I hope will be simpler and more useful than syz.
Here's a challenge: Design a zipper that works for cyclic graphs. There will be 10 GBP for the winner's charity of choice. (jacquesm may give another 10 Euro in addition.)
(Hint: "Purely Functional Datastructures" solves this problem for graphs shaped like a sigle ring. Perhaps this solution can be generalized?)
Please post entries either to HN or send me an email. My address is in my profile.
I can also give more details about rules and conditions, if needed.
P.S. Might as well make it 100 GBP for the first challenge. I am really interested to see whether there's a solution that does it in O(1), like zippers do. (Or alternatively a proof that O(1) to move from node to node is not possible.)
Clojure also has a pretty neat zipper library in contrib. I've used it in projects and I wish I had introductory material as great as this tutorial back then.
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?
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.
[+] [-] jberryman|15 years ago|reply
http://hackage.haskell.org/packages/archive/syz/0.2.0.0/doc/...
Its internals are pretty interesting if you've ever thought about implementing a generic zipper structure. For example it uses Typeable to reify the focus type.
I'm finishing up my own generic zipper library which I hope will be simpler and more useful than syz.
[+] [-] eru|15 years ago|reply
(Hint: "Purely Functional Datastructures" solves this problem for graphs shaped like a sigle ring. Perhaps this solution can be generalized?)
[+] [-] eru|15 years ago|reply
I can also give more details about rules and conditions, if needed.
P.S. Might as well make it 100 GBP for the first challenge. I am really interested to see whether there's a solution that does it in O(1), like zippers do. (Or alternatively a proof that O(1) to move from node to node is not possible.)
[+] [-] jwr|15 years ago|reply
[+] [-] jewbacca|15 years ago|reply
[+] [-] maxtilford|15 years ago|reply
[+] [-] eru|15 years ago|reply
[+] [-] grogers|15 years ago|reply
[+] [-] eru|15 years ago|reply
It's cited as "Conor's paper" in your article. But the link there doesn't work.