FSharp.Core Namespace
Basic definitions of operators, options, functions, results, choices, attributes and plain text formatting.
Contents
- Basic Types
- Basic Operators
- Options
- Strings and Text
- Choices and Results
- Basic Types with Units of Measure
- ByRef and Pointer Types
- Attributes
- Language Primitives
Basic Types
Type | Description |
Single dimensional, zero-based arrays, written |
|
An abbreviation for the CLI type Boolean. |
|
An abbreviation for the CLI type Byte. |
|
An abbreviation for the CLI type Char. |
|
An abbreviation for the CLI type Double. |
|
An abbreviation for the CLI type Single. |
|
An abbreviation for the CLI type Int32. |
|
An abbreviation for the CLI type Int16. |
|
An abbreviation for the CLI type Int32. |
|
An abbreviation for the CLI type Int64. |
|
An abbreviation for the CLI type SByte. |
|
An abbreviation for the CLI type Object. |
|
An abbreviation for the CLI type Object or null. With the 'nullable reference types' feature, this is an alias to 'obj | null'. |
|
The type of mutable references. Use the functions [!] and [:=] to get and set values of this type. |
|
An abbreviation for the CLI type SByte. |
|
An abbreviation for the CLI type UInt32. |
|
An abbreviation for the CLI type UInt16. |
|
An abbreviation for the CLI type UInt32. |
|
An abbreviation for the CLI type UInt64. |
|
An abbreviation for the CLI type Byte. |
|
The type 'unit', which has only one value "()". This value is special and always uses the representation 'null'. |
Basic Operators
Modules | Description |
A set of extra operators and functions. This module is automatically opened in all F# code. |
|
Basic F# Operators. This module is automatically opened in all F# code. |
Options
Type/Module | Description |
Contains operations for working with options. |
|
The type of optional values. When used from other CLI languages the
empty option is the |
|
Contains operations for working with value options. |
|
The type of optional values, represented as structs. |
Strings and Text
Modules | Description |
Extensible printf-style formatting for numbers and other datatypes |
|
Functional programming operators for string processing. Further string operations are available via the member functions on strings and other functionality in System.String and System.Text.RegularExpressions types. |
Choices and Results
Type/Module | Description |
Helper types for active patterns with 2 choices. |
|
Helper types for active patterns with 3 choices. |
|
Helper types for active patterns with 4 choices. |
|
Helper types for active patterns with 5 choices. |
|
Helper types for active patterns with 6 choices. |
|
Helper types for active patterns with 7 choices. |
|
Contains operations for working with values of type Result. |
|
Helper type for error handling without exceptions. |
Basic Types with Units of Measure
Type | Description |
The type of 8-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Byte. |
|
The type of decimal numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Decimal. |
|
The type of double-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Double. |
|
The type of double-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Double. |
|
The type of single-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Single. |
|
The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Int32. |
|
The type of 16-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Int16. |
|
The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Int32. |
|
The type of 64-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Int64. |
|
The type of 8-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to SByte. |
|
The type of machine-sized signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to IntPtr. |
|
The type of 8-bit signed integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to SByte. |
|
The type of single-precision floating point numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Single. |
|
The type of 32-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to UInt32. |
|
The type of 16-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to UInt16. |
|
The type of 32-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to UInt32. |
|
The type of 64-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to UInt64. |
|
The type of 8-bit unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to Byte. |
|
The type of machine-sized unsigned integer numbers, annotated with a unit of measure. The unit of measure is erased in compiled code and when values of this type are analyzed using reflection. The type is representationally equivalent to UIntPtr. |
ByRef and Pointer Types
Type/Module | Description |
Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to |
|
Represents a managed pointer in F# code. |
|
Represents the types of byrefs in F# 4.5+ |
|
Represents an Common IL (Intermediate Language) Signature Pointer. |
|
Represents a in-argument or readonly managed pointer in F# code. This type should only be used with F# 4.5+. |
|
Represents an unmanaged pointer in F# code. |
|
Represents a out-argument managed pointer in F# code. This type should only be used with F# 4.5+. |
|
Represents an untyped unmanaged pointer in F# code. |
Attributes
Type | Description |
Adding this attribute to class definition makes it abstract, which means it need not implement all its methods. Instances of abstract classes may not be constructed directly. |
|
Adding this attribute to a type lets the 'null' literal be used for the type within F# code. This attribute may only be added to F#-defined class or interface types. |
|
Indicates a construct is automatically opened when brought into scope through an assembly reference or then opening of the containing namespace or module. |
|
Adding this attribute to a type with value 'false' disables the behaviour where F# makes the type Serializable by default. |
|
Adding this attribute to a type causes it to be represented using a CLI class. |
|
Adding this attribute to a property with event type causes it to be compiled with as a CLI metadata event, through a syntactic translation to a pair of 'add_EventName' and 'remove_EventName' methods. |
|
Adding this attribute to a record type causes it to be compiled to a CLI representation with a default constructor with property getters and setters. |
|
This attribute is used to indicate a generic container type satisfies the F# 'comparison' constraint only if a generic argument also satisfies this constraint. |
|
This attribute is generated automatically by the F# compiler to tag functions and members that accept a partial application of some of their arguments and return a residual function. |
|
This attribute is inserted automatically by the F# compiler to tag types and methods in the generated CLI code with flags indicating the correspondence with original source constructs. |
|
This attribute is used to adjust the runtime representation for a type.
For example, it may be used to note that the |
|
Indicates one or more adjustments to the compiled representation of an F# type or member. |
|
This attribute is inserted automatically by the F# compiler to tag methods which are given the 'CompiledName' attribute. |
|
Adding this attribute to a value or function definition in an F# module changes the name used for the value in compiled CLI code. |
|
Indicates that a message should be emitted when F# source code uses this construct. |
|
Adding this attribute to a type indicates it is a type with a user-defined implementation of comparison. |
|
Adding this attribute to a type indicates it is a type with a user-defined implementation of equality. |
|
Indicates that a member on a computation builder type is a custom query operator, and indicates the name of that operator. |
|
Adding this attribute to a discriminated union with value false turns off the generation of standard helper member tester, constructor and accessor members for the generated CLI class for that type. |
|
Adding this attribute to a field declaration means that the field is not initialized. During type checking a constraint is asserted that the field type supports 'null'. If the 'check' value is false then the constraint is not asserted. |
|
Adding this attribute to a function indicates it is the entrypoint for an application. If this attribute is not specified for an EXE then the initialization implicit in the module bindings in the last file in the compilation sequence are used as the entrypoint. |
|
This attribute is used to indicate a generic container type satisfies the F# 'equality' constraint only if a generic argument also satisfies this constraint. |
|
This attribute is used to tag values that are part of an experimental library feature. |
|
This attribute is added to generated assemblies to indicate the version of the data schema used to encode additional F# specific information in the resource attached to compiled F# libraries. |
|
Adding this attribute to a non-function value with generic parameters indicates that uses of the construct can give rise to generic code through type inference. |
|
Adding this attribute to a parameter of function type indicates that, if the overall function or method is inlined and the parameter is determined to be a known lambda, then this function should be statically inlined throughout the body of the function of method. |
|
Adding this attribute to a type causes it to be represented using a CLI interface. |
|
Adding this attribute to a value causes it to be compiled as a CLI constant literal. |
|
Adding this attribute to a type causes it to be interpreted as a refined type, currently limited to measure-parameterized types. This may only be used under very limited conditions. |
|
Adding this attribute to a type causes it to be interpreted as a unit of measure. This may only be used under very limited conditions. |
|
Adding this attribute to a type indicates it is a type where comparison is an abnormal operation. This means that the type does not satisfy the F# 'comparison' constraint. Within the bounds of the F# type system, this helps ensure that the F# generic comparison function is not instantiated directly at this type. The attribute and checking does not constrain the use of comparison with base or child types of this type. |
|
Indicates a value or a function that must not be inlined by the F# compiler, but may be inlined by the JIT compiler. |
|
This attribute is used to tag values that may not be dynamically invoked at runtime. This is typically added to inlined functions whose implementations include unverifiable code. It causes the method body emitted for the inlined function to raise an exception if dynamically invoked, rather than including the unverifiable code in the generated assembly. |
|
Adding this attribute to a type indicates it is a type where equality is an abnormal operation. This means that the type does not satisfy the F# 'equality' constraint. Within the bounds of the F# type system, this helps ensure that the F# generic equality function is not instantiated directly at this type. The attribute and checking does not constrain the use of comparison with base or child types of this type. |
|
This attribute is added automatically for all optional arguments. |
|
Indicates that, when a custom operator is used in a computation expression, a parameter is automatically parameterized by the variable space of the computation expression |
|
Adding this attribute to a record or union type disables the automatic generation of overrides for 'System.Object.Equals(obj)', 'System.Object.GetHashCode()' and 'System.IComparable' for the type. The type will by default use reference equality. |
|
Adding this attribute to the let-binding for the definition of a top-level value makes the quotation expression that implements the value available for use at runtime. |
|
This attribute is used to indicate that references to the elements of a module, record or union type require explicit qualified access. |
|
Adding this attribute to a type, value or member requires that uses of the construct must explicitly instantiate any generic type parameters. |
|
Adding this attribute to class definition makes it sealed, which means it may not be extended or implemented. |
|
Indicates the relationship between a compiled entity in a CLI binary and an element in F# source code. |
|
Adding this attribute to a type causes it to be represented using a CLI struct. |
|
Adding this attribute to a record, union, exception, or struct type confirms the automatic generation of implementations for 'System.IComparable' for the type. |
|
Adding this attribute to a record, union or struct type confirms the automatic generation of overrides for 'System.Object.Equals(obj)' and 'System.Object.GetHashCode()' for the type. |
|
This attribute is used to mark how a type is displayed by default when using
'%A' printf formatting patterns and other two-dimensional text-based display layouts.
In this version of F# valid values are of the form |
|
Indicates a function that should be called in a tail recursive way inside its recursive scope. A warning is emitted if the function is analyzed as not tail recursive after the optimization phase. |
|
This attribute is used to tag values whose use will result in the generation of unverifiable code. These values are inevitably marked 'inline' to ensure that the unverifiable constructs are not present in the actual code for the F# library, but are rather copied to the source code of the caller. |
|
Adding this attribute to an F# mutable binding causes the "volatile" prefix to be used for all accesses to the field. |
|
When used in a compilation with null-checking enabled, indicates that a function is meant to be used only with potentially-nullable values and warns accordingly. |
Language Primitives
Type/Module | Description |
Type of a formatting expression. |
|
Type of a formatting expression. |
|
The CLI type used to represent F# function values. This type is not typically used directly, though may be used from other CLI languages. |
|
The CLI type used to represent F# first-class type function values. This type is for use by compiled F# code. |
|
Helper functions for converting F# first class function values to and from CLI representations of functions using delegates. |
|
Language primitives associated with the F# language |
|
Non-exhaustive match failures will raise the MatchFailureException exception |
|
Provides a default implementations of F# numeric literal syntax for literals of the form 'dddI' |
|
An implementation module used to hold some private implementations of function value invocation. |
|
Type of a formatting expression. |
|
Type of a formatting expression. |