My initial inclination is to say that "where" clauses in a signature
are only there for pattern matching, and do not modify the official
type of the parameter within the function body.  However, on a "subset"
the "where" clause is there precisely to contribute to the typing,
so if you want the extra constraints to apply to all uses of the
parameter variable within the body, you'd need to declare a subset
type that enforces it.

On the other hand, I can imagine that an alternative would be to say
that a "where" clause will always "subsetize" the official type;
that would imply that we'd need to add a "when" clause for mere
pattern matching.  Something to be said for making such a distinction,
if it can be taught.

Fuzzily yours,
Larry

Reply via email to