Provide mechanism for precluding types in `fresh-type-variable` invocations
The fresh-type-variable
function allows for specifying a range of potential types to restrict the newly generated type from, e.g., (fresh-type-variable type1 type2)
limits the new variable to being a member of either type1
or type2
and nothing else.
Sometimes, it may be preferable to have the opposite behavior. For example, one might do (fresh-type-variable #:not type1)
, which would be identical to a vanilla call to (fresh-type-variable)
where the only restriction is that the result cannot be the specified type(s).
One way of implementing this might be to provide a binding that returns a list of all available types, e.g., all-types
, and then simply removing the precluded types from that list. I'm not sure how to go about statically generating a list of types like that, though.