[Haskell-cafe] Syntax for lambda case proposal could be "\of"

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Aug 15 13:53:27 EDT 2007


On Wed, 2007-08-15 at 18:23 +0100, Brian Hulley wrote:

> Therefore I propose:
> 
>     \of
>         alts
> 
> which doesn't suffer this problem since the keyword "of" can never 
> follow a '\' in the existing grammar.

Or how about:

\case of
    alts

which seems clearer to me.

Similarly, the keyword "case" can never follow a '\' in the existing
grammar.

Mind you, this doesn't seem to save much over

\x -> case x of
    alts

It'd be more interesting if we could pattern match against multiple
arguments with multiple alternatives like we can in a function
definition. I've no idea what syntax for that should look like however.

Duncan



More information about the Haskell-Cafe mailing list