RFC Or patterns syntax: (p1 | p2) vs. (p1; p2)

Sebastian Graf sgraf1337 at gmail.com
Mon Jul 24 13:25:50 UTC 2023


Hi devs,

I would like to invite you to provide arguments for or against the Or
patterns syntax RFC `(p1; p2)` vs. `(p1 | p2)` over at this GH issue
<https://github.com/ghc-proposals/ghc-proposals/issues/598>.
*In particular, `(p1 | p2)` has a small lead over `(p1; p2)`*, but the
latter will steal syntax from a hypothetical guards-in-patterns extension
`(p | e)` as described here
<https://gitlab.haskell.org/ghc/ghc/-/wikis/view-patterns-alternative>.
I dismissed this point until Vlad made me aware
<https://github.com/ghc-proposals/ghc-proposals/issues/598#issuecomment-1600648262>
of the fact that `f (a -> b)` *could* mean "a pattern match on the type
constructor `(->)`" in a Dependent Haskell future.
Apparently, the existence of the hypothetical guards-in-patterns extension was
reason enough
<https://github.com/ghc-proposals/ghc-proposals/issues/598#issuecomment-1600557467>
to exclude view patterns from GHC2021.
Of course, `(p1; p2)` has issues of its own.
Given how close this vote is, I want to make sure that you, the GHC devs,
are aware of this issue and perhaps have a few minutes to formulate a
(counter) argument or just leave your vote before we submit the winner in
the actual amendment proposal, at which point it will be up to the GHC
steering committee to decide.

Thanks,
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20230724/52aff45b/attachment.html>


More information about the ghc-devs mailing list