[ghc-steering-committee] \cases
Simon Peyton Jones
simonpj at microsoft.com
Thu Jul 29 09:10:40 UTC 2021
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20210729/7e928f42/attachment.html>
More information about the ghc-steering-committee
mailing list