<div dir="ltr"><div>The monomorphism restriction is turned off by default in ghci since version 7.8.1, so you'll see this behavior with newer versions of GHC and the original behavior with older ones.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 1:54 PM, Francesco Ariis <span dir="ltr"><<a href="mailto:fa-ml@ariis.it" target="_blank">fa-ml@ariis.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, May 28, 2015 at 10:54:38PM +0200, Christophe Delord wrote:<br>
> Hello,<br>
><br>
> I'm new here. Sorry if this question has already been asked.<br>
><br>
> I have noticed something strange about type inference.<br>
><br>
> Prelude> :t abs<br>
> abs :: Num a => a -> a<br>
> Prelude> let mapabs = map abs<br>
> Prelude> :t mapabs<br>
> mapabs :: [Integer] -> [Integer]<br>
> Prelude> :t (map abs)<br>
> (map abs) :: Num b => [b] -> [b]<br>
<br>
</span>I just fired up ghci:<br>
<span class=""><br>
λ> let mapabs = map abs<br>
</span> λ> :t mapabs<br>
mapabs :: Num b => [b] -> [b]<br>
<br>
ghc 7.10.1<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>