On Sun, Feb 10, 2013 at 8:51 PM, grant <thelff@hotmail.com> wrote:
Michael Snoyman <michael <at> snoyman.com> writes:

>

Hi Michael,

Just one last thought. Does it make any sense that xml-conduit could be
rewritten as a lens instead of a cursor? Or leverage the lens package somehow?


That's a really interesting idea, I'd never thought about it before. It's definitely something worth playing around with. However, I think in this case the Cursor is providing a totally different piece of functionality than what lenses would do. The Cursor is really working as a Zipper, allowing you to walk the node tree and do queries about preceding and following siblings and ancestors.

Now given that every time I'm on #haskell someone mentions zippers in the context of lens, maybe lens *would* solve this use case as well, but I'm still a lens novice (if that), so I can't really speak on the matter. Maybe someone with more lens experience could provide some insight.

Either way, some kind of lens add-on sounds really useful.

Michael