[ghc-steering-committee] Amend or patterns (#522) to use p1 ; p2 (#609)

Richard Eisenberg lists at richarde.dev
Tue Oct 3 13:11:47 UTC 2023


I'm in support.

> On Oct 3, 2023, at 6:49 AM, Joachim Breitner <mail at joachim-breitner.de> wrote:
> 
> Hi,
> 
> ah, yes, I’m in favor!
> 
> Cheers,
> Joachim
> 
> Am Dienstag, dem 03.10.2023 um 11:17 +0100 schrieb Simon Peyton Jones:
>> Chris
>> 
>> Joachim, Simon, and Richard have yet to vote; but I think you have a
>> majority anyway.  Would you like to move this forward?
>> 
>> Simon
>> 
>> On Fri, 8 Sept 2023 at 11:57, Chris Dornan <chris at chrisdornan.com>
>> wrote:
>>> Proposal: Amend or patterns (#522) to use p1 ; p2 (#609)
>>> Author: Sebastian Graf, David Knothe
>>> Rendered proposal:
>>> https://github.com/ghc-proposals/ghc-proposals/blob/eb4b67c29282520b2c5c6a49c3047dbecb15dde1/proposals/0522-or-patterns.rst
>>> Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/609
>>> Recommendation: Acceptance
>>> 
>>> ## Summary
>>> 
>>> This proposal refines the syntax of an already accpted proposal
>>> (#522) for writing or patterns.
>>> 
>>> The syntax of the old proposal,
>>> 
>>> ```haskell
>>>     stringOfT :: T -> Maybe String
>>>     stringOfT (T1 s)              = Just s
>>>     stringOfT (one of T2{}, T3{}) = Nothing
>>> ```
>>> 
>>> is replaced with
>>> 
>>> ```haskell
>>>     stringOfT :: T -> Maybe String
>>>     stringOfT (T1 s)       = Just s
>>>     stringOfT (T2{}; T3{}) = Nothing
>>> ```
>>> 
>>> or indeed
>>> 
>>> ```haskell
>>>     stringOfT :: T -> Maybe String
>>>     stringOfT x = case x of
>>>       T1 s -> Just s
>>>       T2{}
>>>       T3{} -> Nothing
>>> ```
>>> 
>>> (Beacuse the '(' ... ')' are optional here, we can remove them and
>>> naturally exploit layout.)
>>> 
>>> The authors have conducted polls to see what folks preferred,
>>> landing on this proposal. The
>>> adjustments to the Haskell grammar are really quite minimal
>>> requiring one extra production.
>>> 
>>> ## Recommendation
>>> 
>>> The proposal is nondiruptive and as a whole addresses an important
>>> practical topic. I recommend
>>> that we accept it
>>> 
>>> _______________________________________________
>>> ghc-steering-committee mailing list
>>> ghc-steering-committee at haskell.org
>>> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>> _______________________________________________
>> ghc-steering-committee mailing list
>> ghc-steering-committee at haskell.org
>> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
> 
> -- 
> Joachim Breitner
>  mail at joachim-breitner.de
>  http://www.joachim-breitner.de/
> 
> _______________________________________________
> ghc-steering-committee mailing list
> ghc-steering-committee at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee



More information about the ghc-steering-committee mailing list