[Haskell-cafe] Prolog-style patterns

Roman Cheplyaka roma at ro-che.info
Mon Apr 8 23:07:25 CEST 2013


* Conal Elliott <conal at 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



More information about the Haskell-Cafe mailing list