The Definition of Successor ML specifies that the pattern pat1 | pat2 must be irredundant, which is defined that there must exist a value that is matched by pat2 but not pat1. After discussions with Dave MacQueen, I wonder if the restriction should be that pat1 and pat2 are required to be disjoint; i.e., that there is no value that is matched by both patterns.
This restriction has the property that it makes the | pattern constructor commutative, which I think is intuitive.
The Definition of Successor ML specifies that the pattern
pat1 | pat2must be irredundant, which is defined that there must exist a value that is matched bypat2but notpat1. After discussions with Dave MacQueen, I wonder if the restriction should be thatpat1andpat2are required to be disjoint; i.e., that there is no value that is matched by both patterns.This restriction has the property that it makes the
|pattern constructor commutative, which I think is intuitive.