If you have the Monomorphism restriction set, it will choose types based on the type defaulting rules (Num changes to Integer). This is because polymorphic code is slower than code that has concrete types. Try :set -XNoMonomorphismRestriction, then test it again. It may be that different versions of ghci have a different default for that pragma. On Fri, Jan 27, 2017 at 6:23 AM, Jan Erik Moström <lists@mostrom.pp.se> wrote:
Hi,
Here is something that I don't understand, why does the named value have a different type than just the value itself?
Prelude> let f x = x * x Prelude> :t f f :: Num a => a -> a Prelude> :t [f] [f] :: Num a => [a -> a] Prelude> let g = [f] Prelude> :t g g :: [Integer -> Integer]
= jem _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners