Am Montag, den 09.07.2012, 21:04 +0700 schrieb Mikhail Vorozhtsov:
> Could you express your opinion on the case "comma sugar", i.e.
>
> case x, y of
> P1, P2 -> ...
> P3, P4 -> ...
>
> as sugar for
>
> case (# x, y #) of
> (# P1, P2 #) -> ...
> (# P3, P4 #) -> ...
>
> and respectively
>
> \case
> P1, P2 -> ...
> P3, P4 -> ...
>
> as sugar for
>
> \x y -> case x, y of
> P1, P2 -> ...
> P3, P4 -> ...
>
> ?
Although I wasn’t asked, I want to express my opinion. I think, the use
of the comma is strange. When declaring functions with multiple
arguments, we don’t have commas:
f Nothing y = y
f (Just x) y = x
In lambda expressions for multi-argument functions, we also don’t have
commas:
\x y -> x + y
Why should we have them when using a case-lambda expression for a
multi-argument function?
Best wishes,
Wolfgang
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users