On Saturday 28 October 2006 09:15, Larry Wall wrote:

> 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.

Right; it's awfully difficult to have nominal typing in a room full of 
blank "Hello my name is" tags.

> 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.

-- c

Reply via email to