
5 Oct
2010
5 Oct
'10
2:52 a.m.
To repeat, the analogues in SML and Erlang *do* support multiple clauses (as well as pattern matching) and the failure of Haskell lambdas to do so has always seemed like a weird restriction in a language that's usually free of weird restrictions.
I agree with this sentiment. I have never understood why lambdas can't handle multiple clauses.
I'd prefer to see something like \ 1 -> f | 2 -> g but I'm sure something could be worked out.
This sounds sensible, since the lambda-case clause should really be about having a lambda with support for cases, not a case statement that's implicitly surrounded by a lambda. While I think the "case of" is a good idea, multiple clauses in lambdas seems more canonical to me. Nick