[Haskell-cafe] Recommended class instances for container type

Daniel Fischer daniel.is.fischer at googlemail.com
Thu Dec 8 18:35:14 CET 2011


On Thursday 08 December 2011, 18:13:50, Christoph Breitkopf wrote: 
> Well, including a some file via CPP did look experimental enough to me.
> I'd like to stay away from GHC-only code, if possible.

CPP is standard (maybe not in the sense that it's included in the language 
standard, but every implementation I'm aware of supports CPP).

> 
> > At some point, if you want your container class to be useful to
> > others, you'll want to implement Foldable and Traversable.
> 
> Being useful to others would be the whole point in releasing it at all
> :-)
> 
> Thanks for your explanations - I take this as: "Yes, the Haskell
> community is really using all this stuff in production code, so better
> offer it, or your library might not be that usable."

To varying extent. Stuff can be quite usable without Data or Typeable 
instances. You can start with what you consider most important and add the 
rest when you get feature requests.

> I'll try to be complete, then.
> 
> - Chris




More information about the Haskell-Cafe mailing list