F# Library Reference
This section provides detailed documentation for the F# language's core libraries and types. Explore the namespaces and members to leverage the full power of F# for functional programming.
Introduction
The F# standard library offers a rich set of data structures, algorithms, and utilities designed to support functional programming paradigms. It builds upon the .NET Base Class Library (BCL) and provides F#-idiomatic ways to work with collections, computation expressions, asynchronous programming, and more.
Namespaces
System
This namespace contains fundamental types and operations, many of which are commonly used in F# development.
System.Collections.Generic.IEnumerable<T>
Represents a collection that can be enumerated.
See Full DetailsMicrosoft.FSharp.Collections
Provides F#-specific collection types optimized for functional programming.
FSharpList<T>
Represents an immutable singly-linked list.
Efficient for prepending and recursive processing.
See Full DetailsFSharpSet<T>
Represents an immutable set data structure.
Ensures uniqueness of elements.
See Full DetailsFSharpMap<TKey, TValue>
Represents an immutable map (dictionary) data structure.
Maps keys to values in an immutable fashion.
See Full DetailsMicrosoft.FSharp.Control
Contains types for asynchronous programming and event handling.
Async<T>
Represents an asynchronous computation.
Provides mechanisms for composing and executing asynchronous operations.
See Full DetailsChoice<T1, T2>
Represents a value that can be one of two distinct types.
Useful for representing success/failure or alternative outcomes.
See Full DetailsMicrosoft.FSharp.Core
The core F# library, containing fundamental types, functions, and modules.
Unit
Represents the absence of a value, analogous to void
in imperative languages but used in a functional context.
Microsoft.FSharp.Linq
Provides support for Language Integrated Query (LINQ) in F#.
Types
F# provides various types to represent data effectively. Explore common types like:
- Tuples: For grouping multiple values of potentially different types.
- Records: For creating immutable data structures with named fields.
- Discriminated Unions: For representing data that can take on one of several distinct forms.
- <'T> Seq: For lazy sequences of elements.
- <'T> List: For immutable singly-linked lists.
Functions
Functions are first-class citizens in F#. The library includes a wide array of utility functions for:
- List and Sequence Manipulation
- Pattern Matching
- Asynchronous Programming
- Mathematical Operations
- String Operations
You can also explore the comprehensive .NET API Browser for all available types and members.