Transforming a function to point-free style changes its type
问题 I'm beginning Haskell... I tried to write the following trivial function in two different ways, letting Haskell decide the types, and the type system does something different in each case. What is the explanation for that behavior? Prelude> let f x = 2 * x Prelude> let g = (2*) Prelude> :info f f :: Num a => a -> a -- Defined at <interactive>:1:5 Prelude> :info g g :: Integer -> Integer -- Defined at <interactive>:1:5 Thanks! 回答1: This is known as the monomorphism restriction. Basically, it