
How about \{Left err -> print err; Right msg -> putStrLn msg} ?
2009/11/5 Stefan Monnier
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
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Eugene Kirpichov Web IR developer, market.yandex.ru