[Haskell-cafe] a simple question about types

Alexander Solla ajs at 2piix.com
Wed Nov 17 13:19:55 EST 2010


On Nov 17, 2010, at 10:09 AM, Jerzy M wrote:

>
> So my question is: why (in this second example) Integer is inferred?
> What makes a difference?


I think there are two things going on.  First, the monomorphism  
restriction is causing the types to be different.  I'm not sure why  
Integer -> Integer is the default choice, though.  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.

http://www.haskell.org/haskellwiki/Monomorphism_restriction
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101117/e8d10a11/attachment.html


More information about the Haskell-Cafe mailing list