Closed
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..8
is the range3..5
. If the patterns do not have any intersection then you get the!
pattern. - Specify in the pattern specification that
pat | pat -> pat
no 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
let
bindings:let ((a, _) if a > 5) | (_, a) = (e, f);
would definea
as the value ofe
ife > 5
, and otherwise binda
to the value off
.