teach the/2 about intersection types
Opened this issue · 0 comments
mndrix commented
Intersection types are just a conjunction of two other type constraints. We see their utility in the default types implemented in error:has_type/2
. For example, positive_integer
is really the intersection of positive
and integer
.
Support intersection types with a syntax similar to union types:
the((positive,integer), X)
the((nonempty,list), Xs)
It might be nice to add a little extra sugar so we avoid the extra parens, but I'm not we should at this point:
the(positive, integer, X)