An Alternative Data.List.Zipper

Jeff Wheeler jeff at nokrev.com
Fri Jan 16 23:52:50 EST 2009


Hi,

I'm somewhat of a beginner in Haskell, so take what I say with a grain
of salt, please.

The ListZipper implementation seems very odd to me, and #haskell seemed
to agree with me. The current package implements a Zipper with

> data Zipper = Zipper ![a] ![a]

which allows for empty zippers, among other things. Very strange to me.
It also seems unnecessarily strict. There are also no expected
typeclasses implemented, like Foldable or Traversable.

I thought it would be interesting to try fixing these problems with a
much cleaner design, and I'd like to share what I came up with:

http://hpaste.org/14006

I'd very much appreciate some criticism of the code so that I can
improve it.

I'm not sure how best to provide this alternative on Hackage; should we
make this merely a newer version of the old library, provide it in a
conflicting package, or find a new namespace for it and provide it
there?

Thanks,

Jeff Wheeler



More information about the Libraries mailing list