A type argument is the concrete type supplied to a generic type or function. In F#, angle brackets make an explicit argument visible, as in ResizeArray<int>(), while inference can often determine the type from later usage. section 3.2.3
F# supports several ways to express or infer a generic type argument:
- ResizeArray<int>() explicitly creates a collection of integers. section 3.2.3
- ResizeArray<_>() leaves a type hole for the compiler to resolve. section 3.2.3
- ResizeArray() can infer its element type from operations such as Add; without usable context, inference may require an annotation. section 3.2.3
- A generic function can declare 'T and accept an explicit call such as combineElements<int> 1 2 3. section 3.2.3
Inference and uniform element types
let combineElements a b c = let output = ResizeArray() output.Add a output.Add b output.Add c output combineElements 1 2 3 Automatic generalization lets this function work with integers, strings, or user-defined types, but its arguments must share one inferred type. Combining 1, 2, and "test" produces a type error rather than enabling dynamic mixing. section 3.2.3
mapping : ('T -> 'U) -> 'T list -> 'U list
The List.map signature shows generic arguments 'T and 'U: a mapping function transforms a 'T list into a 'U list, with concrete types determined by use. section 7.2.3




