Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can read Huet's seminal paper on zippers [1]. I found that Edward Z Yang's article[2] explains well the more general zippers.

The generic operation of differentiation to create the the type of zipper is explained in this article[3] from Conor McBride.

Another fun fact about zippers is that they have a comonadic structure, ie from a zipper you can build a zipper of zippers that reifies the concept of moving the cursor. That comonadic structure can express "locality of rules" in cellular automata. This classic article[4] by Dan Piponi uses a 1D automaton. As an exercise, I described an implementation of Conway's game of life in a comonadic manner in [5].

[1]: http://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-...

[2]: http://blog.ezyang.com/2010/04/you-could-have-invented-zippe...

[3]: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.22.8...

[4]: http://blog.sigfpe.com/2006/12/evaluating-cellular-automata-...

[5]: http://blog.emillon.org/posts/2012-10-18-comonadic-life.html



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: