
Folks I've had a final thought about \cases. Looking at it now, I wonder if we can simply expand what LambdaCase allows, rather than having yet another extension. That is, LambdaCase now accepts \cases as well as \case. If we'd designed it from scratch we certainly would not have had two different extensions. The only downside I can see is a loss of back-compat in this program {-# LANGUAGE LambdaCase #-} module Foo where f = \cases -> cases + 1 -- Adds 1 g = \case { True -> False, False -> True } If we extend what LambdaCase does, the definition of f will change its meaning. But this is so bizarre that I'm disinclined to waste time on it. My suggestion: expand what LambdaCase does. If not, the new extension should be LambdaCases. Can you reply on the GitHub? https://github.com/ghc-proposals/ghc-proposals/pull/302 Simon

I think writing an actual comment on Github will be quite noisy. I left you
a thumbs up in the “reaction” area instead.
On Thu, Jul 29, 2021 at 11:11 AM Simon Peyton Jones via
ghc-steering-committee
Folks
I’ve had a final thought about \cases.
Looking at it now, I wonder if we can simply expand what LambdaCase allows, rather than having yet another extension. That is, LambdaCase now accepts \cases as well as \case. If we'd designed it from scratch we certainly would not have had two different extensions.
The only downside I can see is a loss of back-compat in this program
{-# LANGUAGE LambdaCase #-}
module Foo where
f = \cases -> cases + 1 -- Adds 1
g = \case { True -> False, False -> True }
If we extend what LambdaCase does, the definition of f will change its meaning. But this is so bizarre that I'm disinclined to waste time on it.
My suggestion: expand what LambdaCase does. If not, the new extension should be LambdaCases.
Can you reply on the GitHub? https://github.com/ghc-proposals/ghc-proposals/pull/302
Simon _______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
participants (2)
-
Simon Peyton Jones
-
Spiwack, Arnaud