In F# some types have a special generic syntax (I'm not sure what it is called) so that you can do:
int list // instead of List<int>
int option // instead of Option<int>
It is covered in the MSDN on F# Types
Under "generic type":
generic type
type-parameter generic-type-name |
'a list
Or
generic-type-name<type-parameter-list> |
list<'a>
And "constructed types":
constructed type (a generic type that has a specific type argument supplied)
type-argument generic-type-name
or
generic-type-name<type-argument-list>
type dave<'a> = {
V : 'a
};;
let stringDave: dave<string> = { V = "string" };;
//val stringDave : dave<string> = {V = "string";}
let intDave : int dave = { V = 123 };;
//val intDave : dave<int> = {V = 123;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With