[ghc-steering-committee] \cases

Spiwack, Arnaud arnaud.spiwack at tweag.io
Thu Jul 29 14:30:23 UTC 2021


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 <ghc-steering-committee at haskell.org> wrote:

> 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 at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20210729/88918bd6/attachment.html>


More information about the ghc-steering-committee mailing list