Non-H98 crusade, contd.

ross at soi.city.ac.uk ross at soi.city.ac.uk
Sun Feb 27 19:43:10 EST 2005


On Sun, Feb 27, 2005 at 11:47:21AM +0100, Sven Panne wrote:
> OK, let's try to summarize what seems to be the current consensus about
> more or less conservative & settled extensions to Haskell98:
> 
>   a) rank 2 type signatures
>   b) polymorphic components for data constructors
>   c) pattern guards
>   d) data declarations with no constructors
>   e) constraints on typeclass methods
>   f) instances on type synonyms
>   g) relaxation of polymorphic recursion

I take back what I said about instances on type synonyms: they are tied
up with generalized instance heads, which are certainly a major change
from H98, as they break the termination guarantee.

> Probably a) and b) should be considered together(?). Furthermore, currently
> only GHC implements c), but a simple desugaring transformation should be
> enough to implement it in the other Haskell systems and I don't see any
> hard semantic issues here.

All these but pattern guards are implemented in Hugs.  Is such a
desugaring transformation written down anywhere?  That's essential for
describing the extension, but wouldn't be usable as an implementation:
users will be confused by type errors that relate to desugared forms.
(I'm also not sure about the use of monadic binding notation for the
non-monadic matches).

e) is in GHC and Hugs without special flags.
g) is in GHC, Hugs and nhc98, all without any special flags.

I think we should be biased in favour of extensions that give extra
expressiveness, like a), b) and e), over those that simplify things you
could have written anyway.


More information about the Libraries mailing list