<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><font face="arial, sans-serif">On Tue, 10 Aug 2021 at 21:15, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:<br></font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-GB" style="overflow-wrap: break-word;">
<div class="gmail-m_-1780126008951680954WordSection1">
<p class="MsoNormal"> <br></p>
<p class="MsoNormal"><font face="arial, sans-serif">I think you see why the instance sig must be at least as polymorphic ...</font></p></div></div></blockquote><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks Simon, I do now see, but I'd have to say there's a heck of lot of questions on StackOverflow (most not from me) being surprised/asking why. See more below.</font></div><div><font face="arial, sans-serif"> <br></font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1"><p class="MsoNormal"> <br></p></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1">
<p class="MsoNormal"><font face="arial, sans-serif">I agree with David’s (1) and (2) reasons, but not with (3) or (4), neither of which I quite understand.<u></u><u></u></font></p>
<p class="MsoNormal"><font face="arial, sans-serif"><u></u> </font></p></div></div></blockquote><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">(1) is documented in the User Guide, but the magic words "compiler-checked" don't appear.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">(2) is documented and illustrated, but in that example the ScopedTyVar is superfluous.</font></div><div><font face="arial, sans-serif"> </font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1"><p class="MsoNormal"><font face="arial, sans-serif"><u></u></font></p>
<p class="MsoNormal"><font face="arial, sans-serif">There is no compelling reason to make the instance signature
<i>more</i> polymorphic</font></p></div></div></blockquote><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I think there's an ergonomics reason (which is illustrated but not explained):</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">(5) If the instance is constrained, there's no need to repeat the constraints in the InstanceSig, so reducing clutter/making the Sig easier to read (as you say). This results in making the InstanceSig more polymorphic:</font></div><div><font face="arial, sans-serif"><br></font></div><div><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;padding:12px;line-height:1.4;color:rgb(64,64,64)"><font size="2" face="arial, sans-serif"><span class="gmail-kr" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">>    data</span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">T</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">=</span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">MkT</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span>
<span class="gmail-kr" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">>    instance</span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">Eq</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">=></span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">Eq</span> <span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">(</span><span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">T</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span><span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">)</span> <span class="gmail-kr" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">where</span>
<b>>   </b>   <span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">(</span><span class="gmail-o" style="box-sizing:border-box;color:rgb(206,92,0);font-weight:bold">==</span><span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">)</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">::</span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">T</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">-></span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">T</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">-></span> <span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">Bool</span>   <span class="gmail-c1" style="box-sizing:border-box;color:rgb(143,89,2);font-style:italic">-- The signature</span>
<b>>   </b>   <span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">(</span><span class="gmail-o" style="box-sizing:border-box;color:rgb(206,92,0);font-weight:bold">==</span><span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">)</span> <span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">(</span><span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">MkT</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">x1</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">x2</span><span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">)</span> <span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">(</span><span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">MkTy</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">y1</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">y2</span><span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">)</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">=</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">x1</span><span class="gmail-o" style="box-sizing:border-box;color:rgb(206,92,0);font-weight:bold">==</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">y1</span> <span class="gmail-o" style="box-sizing:border-box;color:rgb(206,92,0);font-weight:bold">&&</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">x2</span><span class="gmail-o" style="box-sizing:border-box;color:rgb(206,92,0);font-weight:bold">==</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">y2</span></font></pre></div><div><font face="arial, sans-serif">That Sig could be</font></div><div><font face="arial, sans-serif"><br></font></div><div><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:0px;padding:12px;line-height:1.4;color:rgb(64,64,64)"><font size="2" face="arial, sans-serif"><b>>    </b>  <span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">(</span><span class="gmail-o" style="box-sizing:border-box;color:rgb(206,92,0);font-weight:bold">==</span><span class="gmail-p" style="box-sizing:border-box;color:rgb(0,0,0);font-weight:bold">)</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">::</span> </font><font size="2" style="font-size:small"><span class="gmail-kt" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">Eq</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(0,0,0)">a</span> <span class="gmail-ow" style="box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">=></span></font><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-kt" style="font-size:small;box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">T</span><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-n" style="font-size:small;box-sizing:border-box;color:rgb(0,0,0)">a</span><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-ow" style="font-size:small;box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">-></span><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-kt" style="font-size:small;box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">T</span><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-n" style="font-size:small;box-sizing:border-box;color:rgb(0,0,0)">a</span><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-ow" style="font-size:small;box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">-></span><span style="font-family:monospace,monospace;font-size:small"> </span><span class="gmail-kt" style="font-size:small;box-sizing:border-box;color:rgb(32,74,135);font-weight:bold">Bool</span><span style="font-family:monospace,monospace;font-size:small">   </span><span class="gmail-c1" style="font-size:small;box-sizing:border-box;color:rgb(143,89,2);font-style:italic">-- repeat constraint, but clutter</span></pre></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1"><p class="MsoNormal"> – that is, doing so does not increase expressiveness.  But it might make a briefer, more comprehensible type for the reader.  The only alternative would be to insist that the two types are the same, a completely redundant test, but one
 you might conceivably want on stylistic grounds.</p></div></div></blockquote><div><br></div><div>More to the point: it would bring into scope the ScopedTyVars.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">All in all, no big deal.  Instance signature are a convenience, never a necessity.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If you would like to offer a patch for the user manual to explain this better, that would be great.<u></u><u></u></p>
<p class="MsoNormal"><u></u> </p>
<p class="MsoNormal"><u></u></p></div></div></blockquote><div><br></div><div>[Discussion cont. from first para]:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1"><p class="MsoNormal"> ... [more polymorphic] than the instantiated signature from the class – because that’s what the client is going to expect.  We are building a record of functions, and they must conform to the class signature.</p></div></div></blockquote><div><br></div><div>And that answer is unsatisfactory. It amounts to: we didn't think in advance how useful it would be to put tighter constraints on methods -- particularly for the tyvars that are 'private' to the method/not from the instance head -- that is within Constructor classes. Allowing that would be a partial (heh, heh) way towards 'Restricted Data Types' Hughes 1999 and Eisenberg et al 2020 (ref'ing many earlier attempts), and indeed Haskell Language Report vintage 1990 (the design before 'stupid theta').</div><div><br></div></div><div>I suppose it's beyond a wild dream to allow the InstanceSig to be at least as polymoprhic wrt the types/vars from the instance head but possibly less polymorphic wrt the method's private types/vars? The actual type inferred would be the mgu of the InstanceSig given with the substitution from the instance head & constraints.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB" style="overflow-wrap: break-word;"><div class="gmail-m_-1780126008951680954WordSection1"><p class="MsoNormal"> <u></u></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Glasgow-haskell-users <<a href="mailto:glasgow-haskell-users-bounces@haskell.org" target="_blank">glasgow-haskell-users-bounces@haskell.org</a>>
<b>On Behalf Of </b>David Feuer<br>
<b>Sent:</b> 08 August 2021 09:37<br>
<b>To:</b> Anthony Clayden <<a href="mailto:anthony.d.clayden@gmail.com" target="_blank">anthony.d.clayden@gmail.com</a>><br>
<b>Cc:</b> GHC users <<a href="mailto:glasgow-haskell-users@haskell.org" target="_blank">glasgow-haskell-users@haskell.org</a>><br>
<b>Subject:</b> Re: InstanceSigs -- rationale for the "must be more polymorphic than"<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
To the best of my knowledge, `InstanceSigs` are never strictly necessary. They can, however, be useful for at least four purposes:<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
 <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
1. To provide a compiler-checked reminder of the type.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
2. To bind type variables with `ScopedTypeVariables`.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
3. To generalize the type so you can use polymorphic recursion.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
4. To enhance parametricitry/polymorphism for internal documentation purposes.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
The third reason is probably the main technical one to allow a more general signature, but the fourth is likely helpful too.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
On Sun, Aug 8, 2021, 3:04 AM Anthony Clayden <<a href="mailto:anthony.d.clayden@gmail.com" target="_blank">anthony.d.clayden@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">I can't help but feel InstanceSigs are either superfluous or upside-down. It's this bit in the User Guide:</span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif;color:rgb(64,64,64);background:rgb(252,252,252)">> The type signature in the instance declaration must be</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif;color:rgb(64,64,64);background:rgb(252,252,252)">> more polymorphic than (or the same as) the one in the class declaration,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif;color:rgb(64,64,64);background:rgb(252,252,252)">> instantiated with the instance type.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif;color:rgb(64,64,64);background:rgb(252,252,252)">Usually if you give a signature, it must be _less_ polymorphic (or the same as) the type inferred from the term:</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">>    lessPolyPlus :: Integral a => a -> a -> a</span><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">>    lessPolyPlus x y = x + y</span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">Or</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">>    lessPolyPlus (x :: a) y = x + y :: Integral a => a</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">The examples in the User Guide aren't helping: you could just drop the InstanceSigs, and all is well-typed. (Even the example alleging to use -XScopedTypeVariables in a where sub-decl: you could just put random `xs
 :: [b]` without scoping `b`.) </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">Dropping the Sigs altogether works because the type from the class decl, suitably instantiated, is less polymorphic than inferred from the term. IOW the suitably instantiated type restricts what would otherwise be
 inferred. Situation normal.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">I suppose it might be helpful to give an explicit InstanceSig as 'belt and braces' for the instantiated -- possibly because the instantiation is hard to figure out; possibly because you want to use -XScopedTypeVariables
 within a where-bound sub-decl, as an extra piece of string.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">I can see you mustn't make the InstanceSig _less_ polymorphic than the suitably instantiated.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">But the docos don't give any example where it's essential to provide an InstanceSig _and_  make it strictly more polymorphic. Here all the sigs and annotations are just superfluous:</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">>    maxPolyPlus :: Num a => a -> a -> a<br>
>    maxPolyPlus = (+)<br>
>    </span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">>    class C a  where foo :: a -> T a<br>
>    instance Integral a => C a  where<br>
>      foo :: Num a => a -> T a<br>
>      foo (x :: a) = MkT (maxPolyPlus x x :: Num a => a)</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span style="font-family:Arial,sans-serif">Is there a persuasive example (to put in the User Guide)?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> </p></div></div>
</blockquote>
</div>
</div>
</div>
</div>

</blockquote></div></div>