[Haskell-cafe] Re: proposal: point free case expressions
Stefan Monnier
monnier at iro.umontreal.ca
Thu Nov 5 10:59:34 EST 2009
> We could really use a case statement in which we skip the scrutinee and make
> (case of {})' be syntactic sugar for `(\x -> case x of {})'.
> So we could write:
>> myFunc = anotherFunc $ case of
>> Left err -> print err
>> Right msg -> putStrLn msg
> A minor syntactical addition, a big win!
Since this "case" really defines a function, it seems like it would make
more sense to allow defining anonymous functions by pattern matching.
I.e. instead of "case of", I think it should use "λ", "\", "fn", or ...
Stefan
More information about the Haskell-Cafe
mailing list