[Haskell] An Alternative Data.List.Zipper

roconnor at theorem.ca roconnor at theorem.ca
Sat Jan 17 21:13:06 EST 2009

On Sat, 17 Jan 2009, David Menendez wrote:

> instance Applicative f => Applicative (Backwards f) where
>    pure = B . pure
>    f <*> x = B (unB f <**> unB x)

probably should be f <*> x = B (unB x <**> unB f)

anyhow, this should be part of Control.Applicative.

> This may be terminological confusion. I would have said that a
> PointedList *is* a zipper.

This is what I thought, and what how I initally advised Jeff.  However 
after carefully reading both 
<http://en.wikibooks.org/wiki/Haskell/Zippers> and 
<http://www.cs.nott.ac.uk/~ctm/Dissect.pdf> (Clowns to the left of me, 
jokers to the right), it is clear that formally a zipper focuses on a 
sub-list / sub-tree rather than focusing on a particular node of a list or 
a tree.  Hence zippers are not comonads.

Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

More information about the Haskell mailing list