FSharpValue Type
Contains operations associated with constructing and analyzing values associated with F# types such as records, unions and tuples.
Static members
Static member |
Description
|
||
Full Usage:
FSharpValue.GetExceptionFields(exn, ?bindingFlags)
Parameters:
obj
-
The exception instance.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: objnull array
The fields from the given exception.
|
Reads all the fields from a value built using an instance of an F# exception declaration Assumes the given input is an F# exception value. If not, ArgumentException is raised.
|
||
Full Usage:
FSharpValue.GetRecordField(record, info)
Parameters:
obj
-
The record object.
info : PropertyInfo
-
The PropertyInfo describing the field to read.
Returns: objnull
The field from the record.
|
Reads a field from a record value. Assumes the given input is a record value. If not, ArgumentException is raised.
|
||
Full Usage:
FSharpValue.GetRecordFields(record, ?bindingFlags)
Parameters:
obj
-
The record object.
?bindingFlags : BindingFlags
-
Optional binding flags for the record.
Returns: objnull array
The array of fields from the record.
|
Reads all the fields from a record value. Assumes the given input is a record value. If not, ArgumentException is raised.
|
||
|
Reads a field from a tuple value. Assumes the given input is a tuple value. If not, ArgumentException is raised.
|
||
|
Reads all fields from a tuple. Assumes the given input is a tuple value. If not, ArgumentException is raised.
|
||
Full Usage:
FSharpValue.GetUnionFields(value, unionType, ?bindingFlags)
Parameters:
objnull
-
The input union case.
unionType : Type
-
The union type containing the value.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: UnionCaseInfo * objnull array
The description of the union case and its fields.
|
Identify the union case and its fields for an object Assumes the given input is a union case value. If not, ArgumentException is raised. If the type is not given, then the runtime type of the input object is used to identify the relevant union type. The type should always be given if the input object may be null. For example, option values may be represented using the 'null'.
|
||
|
|||
Full Usage:
FSharpValue.MakeRecord(recordType, values, ?bindingFlags)
Parameters:
Type
-
The type of record to make.
values : objnull array
-
The array of values to initialize the record.
?bindingFlags : BindingFlags
-
Optional binding flags for the record.
Returns: obj
The created record.
|
Creates an instance of a record type. Assumes the given input is a record type.
|
||
|
Creates an instance of a tuple type Assumes at least one element is given. If not, ArgumentException is raised.
|
||
Full Usage:
FSharpValue.MakeUnion(unionCase, args, ?bindingFlags)
Parameters:
UnionCaseInfo
-
The description of the union case to create.
args : objnull array
-
The array of arguments to construct the given case.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: objnull
The constructed union case.
|
Create a union case value.
|
||
Full Usage:
FSharpValue.PreComputeRecordConstructor(recordType, ?bindingFlags)
Parameters:
Type
-
The type of record to construct.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: objnull array -> obj
A function to construct records of the given type.
|
Precompute a function for constructing a record value. Assumes the given type is a RecordType. If not, ArgumentException is raised during pre-computation.
|
||
Full Usage:
FSharpValue.PreComputeRecordConstructorInfo(recordType, ?bindingFlags)
Parameters:
Type
-
The record type.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: ConstructorInfo
A ConstructorInfo for the given record type.
|
Get a ConstructorInfo for a record type
|
||
Full Usage:
FSharpValue.PreComputeRecordFieldReader(info)
Parameters:
PropertyInfo
-
The PropertyInfo of the field to read.
Returns: obj -> objnull
A function to read the specified field from the record.
|
Precompute a function for reading a particular field from a record. Assumes the given type is a RecordType with a field of the given name. If not, ArgumentException is raised during pre-computation. Using the computed function will typically be faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type.
|
||
Full Usage:
FSharpValue.PreComputeRecordReader(recordType, ?bindingFlags)
Parameters:
Type
-
The type of record to read.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: obj -> objnull array
An optimized reader for the given record type.
|
Precompute a function for reading all the fields from a record. The fields are returned in the same order as the fields reported by a call to Microsoft.FSharp.Reflection.Type.GetInfo for this type. Assumes the given type is a RecordType. If not, ArgumentException is raised during pre-computation. Using the computed function will typically be faster than executing a corresponding call to Value.GetInfo because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type.
|
||
|
Precompute a function for reading the values of a particular tuple type Assumes the given type is a TupleType. If not, ArgumentException is raised during pre-computation.
|
||
Full Usage:
FSharpValue.PreComputeTupleConstructorInfo(tupleType)
Parameters:
Type
-
The input tuple type.
Returns: ConstructorInfo * Type option
The description of the tuple type constructor and an optional extra type
for large tuples.
|
Gets a method that constructs objects of the given tuple type. For small tuples, no additional type will be returned. For large tuples, an additional type is returned indicating that a nested encoding has been used for the tuple type. In this case the suffix portion of the tuple type has the given type and an object of this type must be created and passed as the last argument to the ConstructorInfo. A recursive call to PreComputeTupleConstructorInfo can be used to determine the constructor for that the suffix type.
|
||
Full Usage:
FSharpValue.PreComputeTuplePropertyInfo(tupleType, index)
Parameters: Returns: PropertyInfo * (Type * int) option
The description of the tuple element and an optional type and index if the tuple is big.
|
|||
|
Precompute a function for reading the values of a particular tuple type Assumes the given type is a TupleType. If not, ArgumentException is raised during pre-computation.
|
||
Full Usage:
FSharpValue.PreComputeUnionConstructor(unionCase, ?bindingFlags)
Parameters:
UnionCaseInfo
-
The description of the union case.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: objnull array -> objnull
A function for constructing values of the given union case.
|
Precompute a function for constructing a discriminated union value for a particular union case.
|
||
Full Usage:
FSharpValue.PreComputeUnionConstructorInfo(unionCase, ?bindingFlags)
Parameters:
UnionCaseInfo
-
The description of the union case.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: MethodInfo
The description of the constructor of the given union case.
|
A method that constructs objects of the given case
|
||
Full Usage:
FSharpValue.PreComputeUnionReader(unionCase, ?bindingFlags)
Parameters:
UnionCaseInfo
-
The description of the union case to read.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: objnull -> objnull array
A function to for reading the fields of the given union case.
|
Precompute a function for reading all the fields for a particular discriminator case of a union type Using the computed function will typically be faster than executing a corresponding call to GetFields
|
||
Full Usage:
FSharpValue.PreComputeUnionTagMemberInfo(unionType, ?bindingFlags)
Parameters:
Type
-
The type of union to read.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: MemberInfo
The description of the union case reader.
|
Precompute a property or static method for reading an integer representing the case tag of a union type.
|
||
Full Usage:
FSharpValue.PreComputeUnionTagReader(unionType, ?bindingFlags)
Parameters:
Type
-
The type of union to optimize reading.
?bindingFlags : BindingFlags
-
Optional binding flags.
Returns: objnull -> int
An optimized function to read the tags of the given union type.
|
Assumes the given type is a union type. If not, ArgumentException is raised during pre-computation. Using the computed function is more efficient than calling GetUnionCase because the path executed by the computed function is optimized given the knowledge that it will be used to read values of the given type.
|