F#: arithmetic operator and loss of polymorphism (value restriction?)
问题 This code doesn't compile: let f = fun x y -> x <<< y // bit shift let g = fun x y -> x <<< y [<EntryPoint>] let main _ = printfn "%d" <| f 1 10 printfn "%d" <| f 1L 10 // error printfn "%d" <| g 1L 10 0 (7,21): error FS0001: This expression was expected to have type int but here has type int64 http://ideone.com/qktsOb I guess the unifier fixed the type parameters associated with f and g upon seeing their first occurrences. What governs this process? I think this is very similar to "value