On Fri, Mar 6, 2009 at 5:11 PM, Gelf Mrogen <[email protected]> wrote:
> --- On Fri, 3/6/09, Jonathan S. Shapiro <[email protected]> wrote:
>
>> Problem: These two instance resolutions occur in different contexts,
>> and it is entirely possible that we will end up with two DISTINCT
>> instance resolutions.
>
>
> Why is this a problem?   When we were writing function g, the types 'a and
> char
> never unified precisely because we had no need for them to be the same.

That's just my first example. With multi-variable type classes you can
have one variable resolved in one lexical context and the other in
another lexical context. Which lexical context is definitive?
Extending the previous example, consider a type class:

  (TwoTypes 'a 'b)

requiring that (Eq 'a) and (Ord 'b). Now suppose that 'a is resolved
in one place and 'b is resolved in another. It's clear that TwoTypes
isn't resolvable until both variables are resolvable. Since the
requirement (Eq 'a) is a logical consequence of (TwoTypes 'a 'b), a
case can be made that the (Eq 'a) requirement should not be
"recognized" until (TwoTypes 'a 'b) is resolved.


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to