<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">>typeclass Foo 'a 'b where<br>> testFoo: 'a -> 'b -> bool<br><br>>let doFoo: 'b -> bool =<br>> fun b -> testFoo 3 b<br><br><br>Answer: No, instance selection should always be done based on the apparent <br>types of things, never on the actual types. In this case, if there isn't an instance <br>for (testFoo Int a) in scope at the time, it's an error. If you want otherwise, add a<br>typeclass constraint to doFoo. <br><br>Matt<br><br><br>--- On <b>Fri, 3/6/09, Sandro Magi <i><naasking@higherlogics.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Sandro Magi <naasking@higherlogics.com><br>Subject: Re: [bitc-dev] Moose, rugs, and separate compilation<br>To: "Discussions about the BitC language"
<bitc-dev@coyotos.org><br>Date: Friday, March 6, 2009, 9:06 PM<br><br><div class="plainMail">Are you referring to a multi-parameter type class where some type<br>parameters are unknown? In this case, the instance would need to be<br>selected from the set of possible choices once the type is supplied.<br><br>typeclass Foo 'a 'b where<br> testFoo: 'a -> 'b -> bool<br><br>let doFoo: 'b -> bool =<br> fun b -> testFoo 3 b<br><br>Hmm, have to think about that.<br><br>Sandro<br><br>_______________________________________________<br>bitc-dev mailing list<br><a ymailto="mailto:bitc-dev@coyotos.org" href="/mc/compose?to=bitc-dev@coyotos..org">bitc-dev@coyotos.org</a><br><a href="http://www.coyotos.org/mailman/listinfo/bitc-dev" target="_blank">http://www.coyotos.org/mailman/listinfo/bitc-dev</a><br></div></blockquote></td></tr></table><br>