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.String

Represents an immutable sequence of characters.

See Full Details

System.Int32

Represents a 32-bit signed integer.

See Full Details

System.Collections.Generic.IEnumerable<T>

Represents a collection that can be enumerated.

See Full Details

Microsoft.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 Details

FSharpSet<T>

Represents an immutable set data structure.

Ensures uniqueness of elements.

See Full Details

FSharpMap<TKey, TValue>

Represents an immutable map (dictionary) data structure.

Maps keys to values in an immutable fashion.

See Full Details

Microsoft.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 Details

Choice<T1, T2>

Represents a value that can be one of two distinct types.

Useful for representing success/failure or alternative outcomes.

See Full Details

Microsoft.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.

See Full Details

fst

Extracts the first element of a pair.

val fst : ('T1 * 'T2) -> 'T1 See Full Details

snd

Extracts the second element of a pair.

val snd : ('T1 * 'T2) -> 'T2 See Full Details

id

The identity function: returns its input unchanged.

val id : 'a -> 'a See Full Details

Microsoft.FSharp.Linq

Provides support for Language Integrated Query (LINQ) in F#.

Query<T>

Represents a LINQ query.

See Full Details

Types

F# provides various types to represent data effectively. Explore common types like:

Functions

Functions are first-class citizens in F#. The library includes a wide array of utility functions for:

You can also explore the comprehensive .NET API Browser for all available types and members.