[ghc-steering-committee] Amend or patterns (#522) to use p1 ; p2 (#609)
Adam Gundry
adam at well-typed.com
Fri Sep 8 19:58:24 UTC 2023
No objections from me. I tend not to pay too much attention to such
syntactic niceties, but as the authors have gone to the trouble of
surveying the community and implementing the proposal I see no reason
not to accept their suggested syntax.
I did notice that the PR drops Ömer's name from the authors list for
#522, I'm not sure if that was intentional?
Adam
On 08/09/2023 18:47, Vladislav Zavialov wrote:
> In favor
>
> On Fri, Sep 8, 2023 at 6:36 PM Simon Peyton Jones
> <simon.peytonjones at gmail.com <mailto:simon.peytonjones at gmail.com>> wrote:
>
> I don't have a strong opinion here. The authors have done a pretty
> diligent job of exploring syntactic alternatives, and seeking
> feedback from the community. I'm quite content to accept this
> proposal. (We have already accepted the base or-pattern proposal,
> so that's not our subject for debate.)
>
> Simon
>
> On Fri, 8 Sept 2023 at 03:57, Chris Dornan <chris at chrisdornan.com
> <mailto: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 <https://github.com/ghc-proposals/ghc-proposals/blob/eb4b67c29282520b2c5c6a49c3047dbecb15dde1/proposals/0522-or-patterns.rst>
> Discussion:
> https://github.com/ghc-proposals/ghc-proposals/pull/609
> <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
>
--
Adam Gundry, Haskell Consultant
Well-Typed LLP, https://www.well-typed.com/
Registered in England & Wales, OC335890
27 Old Gloucester Street, London WC1N 3AX, England
More information about the ghc-steering-committee
mailing list