Clarification for future readers : This answer was written for the original question before it was updated. Original question:
Are F # signatures mostly useless, unlike OCaml, because F # has no functors?
What are the precedents for F # signatures?
Although F # does not have OCaml modules and functors, it does have interfaces and objects that provide similar, albeit slightly more limited functionality. This requires type signatures, since type inference does not work on them. For instance:
type MyIntf =
abstract member m : sting -> int
let f i = i.m "hello"
// ^ error: cannot lookup member "m" on object "i" of indeterminate type
, , m. , , .
, , F # . F # - , , HM, , , .
f, i:
let f (i : MyIntf) = i.m "hello"
, , , (, , ), .