我开始Haskell ...我尝试以两种不同的方式编写以下平凡函数,让Haskell决定类型,并且类型系统在每个函数中执行一些不同的操作案件。这种行为的解释是什么?将函数转换为无点样式改变其类型
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
谢谢!
可能重复(HTTP:/ /stackoverflow.com/questions/32496864/what-is-the-monomorphism-restriction) – Bakuriu 2015-09-10 08:34:53