[Haskell-cafe] Lambda-case / lambda-if
Donn Cave
donn at avvanta.com
Mon Oct 4 19:49:57 EDT 2010
Quoth "Richard O'Keefe" <ok at cs.otago.ac.nz>,
...
> Erlang manages fine with multiclause 'fun':
>
> (fun (1) -> "One" ; (_) -> "Not-one" end)(1)
>
> ML manages fine with multiclause 'fn':
>
> (fn 1 => "one" | _ => "not-one")(1)
>
> In both cases, the same notation is used for multiclause lambda as
> for single clause lambda. It seems excessively ugly to use
> completely different notation depending on the number of alternatives,
> especially when one of the notations has another, much more common,
> and distinct usage.
Just to be sure, are you saying, rather than
case of
1 -> f
2 -> g
you'd like to see \ support pattern matching etc. like named functions -
\ 1 -> f
2 -> g
?
Donn
More information about the Haskell-Cafe
mailing list