On Mon, Oct 27, 2014 at 4:47 PM, Ovidiu Deac <ovidiudeac@gmail.com> wrote:
Since the definition of expr looks like this:
Prelude> let f x = x * 2

...and 2 is an Int, I would expect that the type inferred for (*)  is (Int -> Int -> Int) and thus f should be (Int -> Int)

    Prelude> :t 2
    2 :: Num a => a

Numeric literals are polymorphic. http://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1360006.4.1 is the official specification of this.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net