Motivating examples for https://ghc.haskell.org/trac/ghc/ticket/10843, https://ghc.haskell.org/trac/ghc/wiki/ArgumentDo
This should allow
curry $ \case
without the dollar giving us weird code
data N = O | S N
add :: N -> N -> N
add = fix
\add -> curry
\case ->
(O, b) -> b
(S a, b) -> S (add a b)
Good for defining a recursive ('curried') binary data type in GHCi without too much noise (as if this matters)
curry \case (Just x, Just y) -> Just (x <> y); _ -> Nothing
I propose an essential language extension,
-XCurryCase
which lets you writecurry \case
as\currycase
🤣