Add meaningful instances to ZipList

Daniel Peebles pumpkingod at gmail.com
Wed Feb 1 19:19:49 CET 2012


I've created a ticket for this at
http://hackage.haskell.org/trac/ghc/ticket/5787. I've been having some
issues with my local install but should put a patch up very soon.

Dan

On Mon, Dec 19, 2011 at 5:32 PM, Brent Yorgey <byorgey at seas.upenn.edu>wrote:

> On Sat, Dec 17, 2011 at 01:37:35PM -0500, Daniel Peebles wrote:
> > I noticed that the ZipList newtype in Control.Applicative has no derived
> > instances at all. We can't show a ZipList, check it for equality, or do
> > anything to it except unpack it or treat it like an Applicative or
> Functor.
> >
> > It seems fairly uncontroversial to suggest adding some instances for it,
> > but there are some minor questions to address: the obvious instances to
> add
> > might be Eq, Ord, Show, Read, and possibly Typeable and/or Data. Are
> there
> > any others I've missed? For the Read/Show instances, do we want manual
> ones
> > that don't use the verbose record-style output? Since it's just defined
> as
> > data ZipList a = ZipList { getZipList :: [a] } to get an easy accessor
> > (does anyone actually use getZipList as a field for record updates?), it
> > might be easier to write the projection manually and change the
> definition
> > to data ZipList a = ZipList [a] with a separate getZipList function, so
> the
> > deriving mechanism can give us a less noisy Show instance.
>
> +1
>
> -Brent
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120201/46416152/attachment.htm>


More information about the Libraries mailing list