F# constructs such as lists, tuples, and function values are all generic, which means they can be instantiated at multiple different types. For example,
string list, and
(int * int) list are all instantiations of the generic family of F#
list types. Likewise,
int -> int and
string -> int are both instantiations of the generic family of F# function types. The F# library and the .NET Framework have many other generic types and operations in addition to these.
Closely related to generics is the notion of subtyping. Generics and subtyping combine to allow you to write code that is generic over families of types. In this chapter, we cover .NET and F# types in general and generics and subtyping in particular. ...