
5 Nov
2009
5 Nov
'09
10:09 a.m.
Hello all, Wouldn't it be nice if we could write point free case statements? I regularly find myself writing down something like this:
myFunc = anotherFunc $ \x -> case x of Left err -> print err Right msg -> putStrLn msg
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! Cheers, -- Sebastiaan Visser