<div dir="ltr">Hello,<div><br></div><div>what Reid says is exactly right---the issue is not really about what instances are present, the problem is that GHC can't determine how to instantiate `t0`.</div><div>Perhaps a more direct way to describe this is as follows:</div><div><br></div><div>Failed to infer type `t0`</div><div>  while solving constraint `Data.String.IsString (t0 Char)`</div><div>  arising from the use of: </div><div>    elem :: a -> t0 a -> Bool<br></div><div><br></div><div>-Iavor</div><div><br></div><div> </div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 9:47 AM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><div class="gmail_quote">On Mon, Aug 3, 2015 at 12:45 PM, Daniel Bergey <span dir="ltr"><<a href="mailto:bergey@teallabs.org" target="_blank">bergey@teallabs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">I thought GHC would infer the type when only one instance is in scope,<br>
at least in some cases, like IsString.  But I could well be wrong about that.</div></blockquote></div><br></span>Typeclasses are open-world; this is not a safe assumption, since instances are global and an instance added elsewhere at some point in the future could therefore break your program.<span class="HOEnZb"><font color="#888888"><br><div><br></div>-- <br><div><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</font></span></div></div>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>