[bitc-dev] Moose, rugs, and separate compilation
Gelf Mrogen
gelfmrogen at yahoo.com
Fri Mar 6 18:14:58 EST 2009
> 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?
My view is that the (single) lexical scope at the position of instance selection should be used for deciding the instance (my reply to Sandro may be relevant here). So in your example, when you go to use operation
foo :: TwoTypes 'a 'b => 'a 'b -> Int
and you call (foo s t), then you use instance selection rules. If you have a rule to convert an instance of Eq s and Ord t into an instance of TwoTypes s t, then you look to see if you can satisfy those (Eq/Ord) instances based on the types of s and t and the instances in scope and whether they inherit instances from the current function.
I'm probably missing your point - a more concrete example that you see being a problem would be helpful in order for me to understand the issue.
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.coyotos.org/pipermail/bitc-dev/attachments/20090306/c1e49fbb/attachment.html
More information about the bitc-dev
mailing list