
9 Apr
2013
9 Apr
'13
8:20 a.m.
* Daniel Trstenjak
Hi Roman,
In fact, lots of Haskell newcomers are surprised that
f 10 = 42
is not the same as
n = 10 f n = 42
Well, yes, at the beginning I've been also surprised about this.
But allowing this seems to be even more error prone, because now you could "bind" function arguments to values by just importing a module.
Oh, don't get me wrong — I'd never actually suggest that semantics. Just saying that allowing one and not other would confuse the newcomers about how pattern matching actually works. So I prefer to stay on the simple and consistent side. Roman