<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 17, 2010, at 10:09 AM, Jerzy M wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br>So my question is: why (in this second example) Integer is inferred?<br>What makes a difference?<br></span></blockquote></div><div><br></div>I think there are two things going on. &nbsp;First, the monomorphism restriction is causing the types to be different. &nbsp;I'm not sure why Integer -&gt; Integer is the default choice, though. &nbsp;I tend to write the type signatures I want before I write the implementation, so I don't run into these kinds of issues often.<div><br></div><div><a href="http://www.haskell.org/haskellwiki/Monomorphism_restriction">http://www.haskell.org/haskellwiki/Monomorphism_restriction</a></div></body></html>