[Haskell-cafe] Prolog-style patterns

Daniel Trstenjak daniel.trstenjak at gmail.com
Tue Apr 9 09:37:46 CEST 2013


Hi Roman,

> 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

I don't think that it's inconsistent, because the 'case' defines a new name
scope, like the function does for its arguments.

Otherwise you would also expect a different behavior for:

x = 2

myEq x x = True


Greetings,
Daniel



More information about the Haskell-Cafe mailing list