我对为什么第三个功能不起作用感到困惑:
let generate1 = id
let generate2 = let a = 1
id
let generate3 = printfn "hi"
id
虽然前两个很好,最后一个吐出来
error FS0030: Value restriction. The value 'generate3' has been inferred to have generic type
val generate3 : ('_a -> '_a)
Either make the arguments to 'generate3' explicit or, if you do not intend for it to be generic, add a type annotation.