Understanding F# types: Introduction
F# is not just about functions; the powerful type system is another key ingredient. And just as with functions, understanding the type system is critical to being fluent and comfortable in the language.
Now, so far we have seen some basic types that can be used as input and output to functions:
- Primitive types such as
- Simple function types such as
- Generic types.
None of these types should be unfamiliar. Analogues of these are available in C# and other imperative languages.
But in this series we are going to introduce some new kinds of types that are very common in functional languages but uncommon in imperative languages.
The extended types we will look at in this series are:
- The Option type
- Enum types
For all these types, we will discuss both the abstract principles and the details of how to use them in practice.
Lists and other recursive data types are also very important types, but there is so much to say about them that they will need their own series!