Data types

F# has a rich data type system. We can broadly classify them as:

  • Integral typessbyte, byte, int16, uint16, int32, uint32, int64, and bigint
  • Floating point typesfloat32, float, and decimal
  • Text typeschar and string 
  • Other typesbool

These types are also referred to as fundamental primitive types in F#. Apart from these, F# has an exhaustive list of predefined types as well, such as lists, arrays, records, enumerations, tuples,  units, sequences, and so on. It is recommended that a person learning F# goes through the official Microsoft documentation on F# at https://docs.microsoft.com/en-us/dotnet/fsharp/.

Get .NET Core 2.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.