[Haskell-cafe] Multi-pattern LambdaCase?

Roman Cheplyaka roma at ro-che.info
Tue Jan 27 13:05:05 UTC 2015


On 27/01/15 14:38, Tom Ellis wrote:
> Is there a particular reason that LambdaCase does not support muliple
> patterns?  Specifically I am suggesting that
> 
>     \case { pA1 pA2 pA3 -> eA, ... }
> 
> be sugar for
> 
>     \freshName1 freshName2 freshName3
>         -> case freshName1 freshName2 freshName3 of { pA1 pA2 pA3 -> eA, ... }
> 
> Is there some technical reason that prevents it?

That'd introduce a syntactic ambiguity; pA1 pA2 pA3 is a valid pattern
by itself (as in "Just True").

Roman


More information about the Haskell-Cafe mailing list