Instances for data types
Malcolm.Wallace at cs.york.ac.uk
Fri Apr 30 11:20:47 EDT 2004
> > This raises a general
> > question: What instances should be defined in the standard libraries
> > for types like
> > this? A general policy would be a good thing. IMHO, at least Read,
> > Show, Typeable and Eq could be expected, having Ord, Enum and
> > Bounded, too, would be nice.
> Good point. I've been meaning to create a separate document so we have
> somewhere to collect general library policies like this. It's on my
And I agree that Sven's suggestion would be a good policy. i.e.
Eq, Show, Read, Typeable
should always defined as instances, and
Ord, Enum, Bounded
should be defined as instances if they make sense for this type.
More information about the Libraries