Declaring generic types in F#
March 19, 2017 Leave a comment
Generic types have type parameters in F#. This is no surprise to those coming from other languages like Java and C#. Generics increases the flexibility of objects by letting one or more of its properties take on multiple types.
In F# type parameters are declared using the single quote followed by the type name like here:
type Container<'a> = {description: string; containedValue: 'a}