<div dir="ltr">Ah, thanks for the explanation. I hadn't heard of ExtendedDefaultRules before.<div><br></div><div style>Peter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 8 June 2013 14:35, 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="im">On Sat, Jun 8, 2013 at 9:02 AM, Peter Hall <span dir="ltr"><<a href="mailto:peter.hall@memorphic.com" target="_blank">peter.hall@memorphic.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">This is confusing me, and I'm wondering if it's a compiler bug. I have this:<br>
<div><br></div><div> foo = (++) `on` show</div><div><br></div><div>I'm expecting the type to be:</div>
<div><br></div><div> foo :: Show a => a -> a -> String</div><div><br></div><div>But GHCI is inferring:</div><div><br></div><div> foo :: () -> () -> String</div></div></blockquote><div><br></div></div>
<div>
No bug; it's the monomorphism restriction combining with extended defaulting to infer a monomorphic type. If you want to keep the monomorphism restriction and throw a type error, disable ExtendedDefaultRules.</div><span class="HOEnZb"><font color="#888888"><div>
<br></div></font></span></div><span class="HOEnZb"><font color="#888888">-- <br><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>
</font></span></div></div>
</blockquote></div><br></div>