FSharp.Core


FSharpType Type

Contains operations associated with constructing and analyzing F# types such as records, unions and tuples

Static members

Static member Description

FSharpType.GetExceptionFields(exceptionType, ?bindingFlags)

Full Usage: FSharpType.GetExceptionFields(exceptionType, ?bindingFlags)

Parameters:
    exceptionType : Type - The exception type to read.
    ?bindingFlags : BindingFlags - Optional binding flags.

Returns: PropertyInfo[] An array containing the PropertyInfo of each field in the exception.

Reads all the fields from an F# exception declaration, in declaration order

Assumes exceptionType is an exception representation type. If not, ArgumentException is raised.

exceptionType : Type

The exception type to read.

?bindingFlags : BindingFlags

Optional binding flags.

Returns: PropertyInfo[]

An array containing the PropertyInfo of each field in the exception.

ArgumentException Thrown if the given type is not an exception.

FSharpType.GetFunctionElements(functionType)

Full Usage: FSharpType.GetFunctionElements(functionType)

Parameters:
    functionType : Type - The input function type.

Returns: Type * Type A tuple of the domain and range types of the input function.

Gets the domain and range types from an F# function type or from the runtime type of a closure implementing an F# type

functionType : Type

The input function type.

Returns: Type * Type

A tuple of the domain and range types of the input function.

FSharpType.GetRecordFields(recordType, ?bindingFlags)

Full Usage: FSharpType.GetRecordFields(recordType, ?bindingFlags)

Parameters:
    recordType : Type - The input record type.
    ?bindingFlags : BindingFlags - Optional binding flags.

Returns: PropertyInfo[] An array of descriptions of the properties of the record type.

Reads all the fields from a record value, in declaration order

Assumes the given input is a record value. If not, ArgumentException is raised.

recordType : Type

The input record type.

?bindingFlags : BindingFlags

Optional binding flags.

Returns: PropertyInfo[]

An array of descriptions of the properties of the record type.

FSharpType.GetTupleElements(tupleType)

Full Usage: FSharpType.GetTupleElements(tupleType)

Parameters:
    tupleType : Type - The input tuple type.

Returns: Type[] An array of the types contained in the given tuple type.

Gets the tuple elements from the representation of an F# tuple type.

tupleType : Type

The input tuple type.

Returns: Type[]

An array of the types contained in the given tuple type.

FSharpType.GetUnionCases(unionType, ?bindingFlags)

Full Usage: FSharpType.GetUnionCases(unionType, ?bindingFlags)

Parameters:
    unionType : Type - The input union type.
    ?bindingFlags : BindingFlags - Optional binding flags.

Returns: UnionCaseInfo[] An array of descriptions of the cases of the given union type.

Gets the cases of a union type.

Assumes the given type is a union type. If not, ArgumentException is raised during pre-computation.

unionType : Type

The input union type.

?bindingFlags : BindingFlags

Optional binding flags.

Returns: UnionCaseInfo[]

An array of descriptions of the cases of the given union type.

ArgumentException Thrown when the input type is not a union type.

FSharpType.IsExceptionRepresentation(exceptionType, ?bindingFlags)

Full Usage: FSharpType.IsExceptionRepresentation(exceptionType, ?bindingFlags)

Parameters:
    exceptionType : Type - The type to check.
    ?bindingFlags : BindingFlags - Optional binding flags.

Returns: bool True if the type check is an F# exception.

Returns true if the typ is a representation of an F# exception declaration

exceptionType : Type

The type to check.

?bindingFlags : BindingFlags

Optional binding flags.

Returns: bool

True if the type check is an F# exception.

FSharpType.IsFunction(typ)

Full Usage: FSharpType.IsFunction(typ)

Parameters:
    typ : Type - The type to check.

Returns: bool True if the type check succeeds.

Return true if the typ is a representation of an F# function type or the runtime type of a closure implementing an F# function type

typ : Type

The type to check.

Returns: bool

True if the type check succeeds.

FSharpType.IsModule(typ)

Full Usage: FSharpType.IsModule(typ)

Parameters:
    typ : Type - The type to check.

Returns: bool True if the type check succeeds.

Return true if the typ is a Type value corresponding to the compiled form of an F# module

typ : Type

The type to check.

Returns: bool

True if the type check succeeds.

FSharpType.IsRecord(typ, ?bindingFlags)

Full Usage: FSharpType.IsRecord(typ, ?bindingFlags)

Parameters:
    typ : Type - The type to check.
    ?bindingFlags : BindingFlags - Optional binding flags.

Returns: bool True if the type check succeeds.

Return true if the typ is a representation of an F# record type

typ : Type

The type to check.

?bindingFlags : BindingFlags

Optional binding flags.

Returns: bool

True if the type check succeeds.

FSharpType.IsTuple(typ)

Full Usage: FSharpType.IsTuple(typ)

Parameters:
    typ : Type - The type to check.

Returns: bool True if the type check succeeds.

Return true if the typ is a representation of an F# tuple type

typ : Type

The type to check.

Returns: bool

True if the type check succeeds.

FSharpType.IsUnion(typ, ?bindingFlags)

Full Usage: FSharpType.IsUnion(typ, ?bindingFlags)

Parameters:
    typ : Type - The type to check.
    ?bindingFlags : BindingFlags - Optional binding flags.

Returns: bool True if the type check succeeds.

Returns true if the typ is a representation of an F# union type or the runtime type of a value of that type

typ : Type

The type to check.

?bindingFlags : BindingFlags

Optional binding flags.

Returns: bool

True if the type check succeeds.

FSharpType.MakeFunctionType(domain, range)

Full Usage: FSharpType.MakeFunctionType(domain, range)

Parameters:
    domain : Type - The input type of the function.
    range : Type - The output type of the function.

Returns: Type The function type with the given domain and range.

Returns a Type representing the F# function type with the given domain and range

domain : Type

The input type of the function.

range : Type

The output type of the function.

Returns: Type

The function type with the given domain and range.

FSharpType.MakeStructTupleType(asm, types)

Full Usage: FSharpType.MakeStructTupleType(asm, types)

Parameters:
    asm : Assembly - Runtime assembly containing System.ValueTuple definitions.
    types : Type[] - An array of types for the tuple elements.

Returns: Type The type representing the struct tuple containing the input elements.

Returns a Type representing an F# struct tuple type with the given element types

asm : Assembly

Runtime assembly containing System.ValueTuple definitions.

types : Type[]

An array of types for the tuple elements.

Returns: Type

The type representing the struct tuple containing the input elements.

FSharpType.MakeTupleType(asm, types)

Full Usage: FSharpType.MakeTupleType(asm, types)

Parameters:
    asm : Assembly - Runtime assembly containing System.Tuple definitions.
    types : Type[] - An array of types for the tuple elements.

Returns: Type The type representing the tuple containing the input elements.

Returns a Type representing an F# tuple type with the given element types

asm : Assembly

Runtime assembly containing System.Tuple definitions.

types : Type[]

An array of types for the tuple elements.

Returns: Type

The type representing the tuple containing the input elements.

FSharpType.MakeTupleType(types)

Full Usage: FSharpType.MakeTupleType(types)

Parameters:
    types : Type[] - An array of types for the tuple elements.

Returns: Type The type representing the tuple containing the input elements.

Returns a Type representing an F# tuple type with the given element types

types : Type[]

An array of types for the tuple elements.

Returns: Type

The type representing the tuple containing the input elements.