9 Apr
2013
9 Apr
'13
5:07 a.m.
* Conal Elliott <conal@conal.net> [2013-04-08 07:06:17-0700]
What you're suggesting is called "non-linear patterns", and it's a perfectly sensible, well-defined feature in a language with pattern-matching.
One issue with it in Haskell is that it'd lead to inconsistent semantics: myEq x x = True is not the same as myEq x y = case y of x -> True IINM, in Erlang they have non-linear patterns, and no name shadowing, to be consistent. Roman