[Haskell-cafe] Prolog-style patterns
jan.stolarek at p.lodz.pl
Tue Apr 9 13:32:33 CEST 2013
> Also, for some history, this was discussed a while back:
Thanks for pointing me to earlier discussions on this subject - they are enlightening :) One
particular argument "against" seems to be very convincing to me:
"From a language design point of view, it should be noted that turning
non-left linear patterns into ones with == guards elevates the class Eq
to built-in status - but the compiler has no semantic control over it."
I see there are many things I didn't consider (and many more that I don't even understand). So is
there some recommended reading on the subject of linear patterns? Most of all I'm wondering why
they are called "linear"?
Regarding the possibility of making accidental mistakes during refactoring etc. This could be
implemented as a language extension, requiring explicit LANGUAGE pragma. So people using it would
know they have semantics slightly changed and need to be aware that there is a possibility of
making these kind of mistakes.
More information about the Haskell-Cafe