[Haskell-cafe] Recommended class instances for container type

Johan Tibell johan.tibell at gmail.com
Thu Dec 8 20:41:16 CET 2011


On Thu, Dec 8, 2011 at 8:12 AM, Christoph Breitkopf <
chbreitkopf at googlemail.com> wrote:

> Hello,
>
> I'm in the process of implementing a container data type, and wonder what
> class instances are generally considered necessary. E.g. is it ok to start
> out with a Show that's adequate for debugging, or is it a 'must' to include
> instances of everything possible (Eq, Ord if possible, Read, Show, Functor,
> ...).
>

Start out with Show and spend your time making sure that you're container
type performs well (unless you're doing this as an exercise of course). A
featureful API for something that's as slow as linked lists isn't very
useful. ;)

-- Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111208/738ff795/attachment.htm>


More information about the Haskell-Cafe mailing list