haskell-issues
haskell-issues copied to clipboard
Language extension: caseMay
caseMay x of
A -> a
B -> b
would be desugared to
case x of
A -> Just a
B -> Just b
_ -> Nothing
. Then there would be the corresponding LambdaCase equivalent and perhaps this would all be generalized to any Alternative. Compare fail's use in do notation.