3 ms·
F# is a statically typed language with gradual typing and full type inference. Given let hello value = printfn "%A" value hello "world" hello
by neonsunset 2y ago
F# is a statically typed language with gradual typing and full type inference.
Given
let hello value =
printfn "%A" value
hello "world"
hello 2
The binding "hello" has "'a -> unit" signature where 'a is a generic argument it accepts because the "printfn" binding with a given format specifier is generalized the same way and an unconstrained 'T (here 'a) is the most narrow type inferred for "hello".
- debugnik 2y ago> with gradual typing Isn't gradual typing widely understood to mean "gradual between static and dynamic", which F# certainly isn't?