On 2017-04-19T10:34:31 -0400
Brian Goetz <[email protected]> wrote:
> 
> Yes, we considered it.  But the reason for preferring var here is not 
> necessarily just compiler complexity; it's that it's weird for
> 
>      if (x matches Foo(y))
> 
> to be a _declaration_ for y.  Java developers are not used to that. 

Strongly agree here. I've taken a few programmers with no Haskell
experience through introductions to Haskell and one thing that reliably
trips them up is that patterns introduce bindings in a way that's not
totally explicit.

  f :: Nat -> Nat
  f Zero     = ...
  f (Succ z) = ...

"Where is this z variable declared?! Oh, right..."

M

Reply via email to