Excellent list. It seems like every time I hear about a problem with the MMR, I go &quot;wow, how come I never ran across that? oh yeah, because I write type signatures...&quot;<div><br><div class="gmail_quote">On Thu, Feb 26, 2009 at 5:51 PM, Felipe Lessa <span dir="ltr">&lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Thu, Feb 26, 2009 at 7:25 PM, Thomas Davie &lt;<a href="mailto:tom.davie@gmail.com">tom.davie@gmail.com</a>&gt; wrote:<br>

&gt; I&#39;m not 100% certain here, so someone may correct me, but I think this is<br>
&gt; what&#39;s going on:<br>
</div>[snip]<br>
<br>
Yep, that&#39;s right. Is it just me or the monomorphism restriction<br>
suddenly became the hot topic here on beginners?<br>
<div class="Ih2E3d"><br>
&gt; Another way to write it ofc would simply be uncurry (==).<br>
<br>
</div>Better yet, write a type signature. I highly recommend writing type<br>
signatures for *all* top-level definitions, including non-exported<br>
ones:<br>
<br>
- You avoid most cases where the monomorphism restriction would bother you.<br>
<br>
- You avoid type errors on other functions (sometimes you make a<br>
mistake but the code type checks with a wrong signature, and the type<br>
error shows up only when you use the function elsewhere).<br>
<br>
- It gives you some insights before implementing, and helps whoever<br>
reads your code.<br>
<br>
- It allows you to specialize the code when polymorphism is not needed.<br>
<br>
Probably there are other reasons as well, but these are the most prominent.<br>
<br>
--<br>
<font color="#888888">Felipe.<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>