-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
This is the initial issue to reopen a few of the items from #99, not all but the ones that would be the most useful.
- The idea of the empty pattern,
!something that will never match anything. - Extend the use of the
&operator to be used for pattern set intersections:1..5 & 3..8is the range3..5. If the patterns do not have any intersection then you get the!pattern. - Specify in the pattern specification that
pat | pat -> patno matter the location. This basically means that the|operator is used with patterns as a pattern set union operator. The requirement is that the patterns must extend over the same type just like in match statements currently. - Add pattern guards (pattern if condition) to patterns properly. Once again, this would make the pattern syntax consistent with that of match arms. It could also be useful within
letbindings:let ((a, _) if a > 5) | (_, a) = (e, f);would defineaas the value ofeife > 5, and otherwise bindato the value off.
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.