We're all used to pattern-matching for cases when something is a particular type, e.g.,
match x with
| Y(x) :: tail -> ... // assumes List.head(x) is of type Y(x)
But how can can I match the case when something is not of a particular type? E.g.,
match x with
| Not Y(_) :: tail -> ... // List.head(x) is definitely not a Y
Thanks!
While there is no direct support for
Not
you can use a partial active pattern.output