[Haskell-cafe] Re: Monad Set via GADT

Benjamin Franksen benjamin.franksen at bessy.de
Thu Jan 11 16:06:16 EST 2007


Jim Apple wrote:
> On 1/3/07, Roberto Zunino <zunino at di.unipi.it> wrote:
>> 1) Why the first version did not typececk?
> 1) Class constraints can't be used on pattern matching. They ARE
> restrictive on construction, however. This is arguably bug in the
> Haskell standard. It is fixed in GHC HEAD for datatypes declared in
> the GADT way, so as not to break H98 code:
>
http://article.gmane.org/gmane.comp.lang.haskell.cvs.all/29458/match=gadt+class+context

To quote from there: "I think this is stupid, but it's what H98 says."

Maybe it is time to consider it deprecated to follow the Haskell 98
standard /to the letter/. The above is an example where the default
(without flags) should (arguably) be the 'fixed' standard. We would need an
equivalent of gcc's -pedantic flag, meaning "Follow the Haskell 98 standard
to the letter, even on issues where the standard is generally considered
bad".

I hope this will be handled in a better way with Haskell'. It should be
possible to revise the standard (every few years or so, /very/
conservatively i.e. no extensions, etc) so that we can eliminate 'bugs'
from the language spec.

Cheers
Ben



More information about the Haskell-Cafe mailing list