<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 24, 2015 at 12:48 PM, Clinton Mead wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":9vw" class="a3s" style="overflow:hidden">After implementing the steps in (c), T is an instance of both C and C1, and both those instances define foo the same way. The only way I see a problem if is a module imports both C1 and C unqualified (they'll clash) <span></span>but I see no reason to do that.</div></blockquote></div><br>It's hard to respond with vague details. It may be in your case that what you say works. But this is not true in the general case. Consider the following simple example.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- | A module out of your control<br></div><div class="gmail_extra">module A where</div><div class="gmail_extra">data T = T</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- | A module out of your control</div><div class="gmail_extra">module B where</div><div class="gmail_extra">class Show a where</div><div class="gmail_extra">  show :: a -> String</div><div class="gmail_extra">print :: Show a => a -> IO ()</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- | A module under your control</div><div class="gmail_extra">module C where</div><div class="gmail_extra">import A</div><div class="gmail_extra">import B</div><div class="gmail_extra">class Show' a where</div><div class="gmail_extra">  show' :: a -> String</div><div class="gmail_extra">instance Show' T where</div><div class="gmail_extra">  show' T = "T"</div><div class="gmail_extra"><br></div><div class="gmail_extra">Now, you can use "show' T" anywhere you could use "show T" because the result of both functions is the same (monomorphic) type.</div><div class="gmail_extra"><br></div><div class="gmail_extra">But you can't use "print T" from module B because you do not have an instance for Show of T. You could define a function "print' :: Show' a => a -> IO ()", but you are not using the functions that rely on Show (a.k.a. the "machinery" mentioned by Miguel). Thus, you lose out on the common functionality that presumably exists for Show.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Sean</div></div>