-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Extend Patterns #2150
Copy link
Copy link
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.
!something that will never match anything.&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.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.letbindings:let ((a, _) if a > 5) | (_, a) = (e, f);would defineaas the value ofeife > 5, and otherwise bindato the value off.