Major type-class overhaul

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri Nov 17 18:40:02 EST 2006


On Fri, 2006-11-17 at 23:29 +0000, Manuel M T Chakravarty wrote:

> > This feature has been often requested, becuase it allows you to
> > package a dictionary into an ordinary (non-existential) data type, and
> > be able to use it.
> > 
> > NOTE: the Haskell 98 syntax for data type declarations
> >         data Num a => T a = T1 a
> > behaves exactly as specified in H98, and *not* in the new way.
> > The Num dictionary is
> >         *required* when constructing, and
> >         *required* when matching
> > I think this is stupid, but it's what H98 says.  To get the new
> > behaviour, use GADT-style syntax, even though the data type being
> > defined is does not use the GADT-ness.
> 
> We may want to propose to change that for Haskell'.  What do you think?

I'd certainly support that. Am I right in thinking that it'd allow
Data.Set to be made an instance of Monad, because the Ord constraint
would be available in the body of the bind method?

Could it actually break any existing programs? I can't think how.

Duncan



More information about the Glasgow-haskell-users mailing list