FSharpReflectionExtensions Module
Defines further accessing additional information about F# types and F# values at runtime.
Type extensions
Type extension | Description | ||
Full Usage:
FSharpValue.GetExceptionFields(exn, ?allowAccessToPrivateRepresentation)
Parameters:
obj
-
The exception instance.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj array
The fields from the given exception.
|
Assumes the given input is an F# exception value. If not, ArgumentException is raised.
Extended Type:
|
||
Full Usage:
FSharpType.GetExceptionFields(exceptionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The exception type to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: PropertyInfo array
An array containing the PropertyInfo of each field in the exception.
|
Assumes
Extended Type:
|
||
Full Usage:
FSharpValue.GetRecordFields(record, ?allowAccessToPrivateRepresentation)
Parameters:
obj
-
The record object.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj array
The array of fields from the record.
|
Assumes the given input is a record value. If not, ArgumentException is raised.
Extended Type:
|
||
Full Usage:
FSharpType.GetRecordFields(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The input record type.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: PropertyInfo array
An array of descriptions of the properties of the record type.
|
Assumes the given input is a record value. If not, ArgumentException is raised.
Extended Type:
|
||
Full Usage:
FSharpType.GetUnionCases(unionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The input union type.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: UnionCaseInfo array
An array of descriptions of the cases of the given union type.
|
Assumes the given type is a union type. If not, ArgumentException is raised during pre-computation.
Extended Type:
|
||
Full Usage:
FSharpValue.GetUnionFields(value, unionType, ?allowAccessToPrivateRepresentation)
Parameters:
obj
-
The input union case.
unionType : Type
-
The union type containing the value.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: UnionCaseInfo * obj array
The description of the union case and its fields.
|
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'.
Extended Type:
|
||
Full Usage:
FSharpType.IsExceptionRepresentation(exceptionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type to check.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: bool
True if the type check is an F# exception.
|
Extended Type:
|
||
Extended Type:
|
|||
Extended Type:
|
|||
Full Usage:
FSharpValue.MakeRecord(recordType, values, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of record to make.
values : obj array
-
The array of values to initialize the record.
?allowAccessToPrivateRepresentation : bool
-
Optional flags that denotes accessibility of the private representation.
Returns: obj
The created record.
|
Assumes the given input is a record type.
Extended Type:
|
||
Full Usage:
FSharpValue.MakeUnion(unionCase, args, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case to create.
args : obj array
-
The array of arguments to construct the given case.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj
The constructed union case.
|
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeRecordConstructor(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of record to construct.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj array -> obj
A function to construct records of the given type.
|
Assumes the given type is a RecordType. If not, ArgumentException is raised during pre-computation.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeRecordConstructorInfo(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The record type.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: ConstructorInfo
A ConstructorInfo for the given record type.
|
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeRecordReader(recordType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of record to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj -> obj array
An optimized reader for the given record 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.
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionConstructor(unionCase, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj array -> obj
A function for constructing values of the given union case.
|
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionConstructorInfo(unionCase, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: MethodInfo
The description of the constructor of the given union case.
|
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionReader(unionCase, ?allowAccessToPrivateRepresentation)
Parameters:
UnionCaseInfo
-
The description of the union case to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj -> obj array
A function to for reading the fields of the given union case.
|
Using the computed function will typically be faster than executing a corresponding call to GetFields
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionTagMemberInfo(unionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of union to read.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: MemberInfo
The description of the union case reader.
|
Extended Type:
|
||
Full Usage:
FSharpValue.PreComputeUnionTagReader(unionType, ?allowAccessToPrivateRepresentation)
Parameters:
Type
-
The type of union to optimize reading.
?allowAccessToPrivateRepresentation : bool
-
Optional flag that denotes accessibility of the private representation.
Returns: obj -> int
An optimized function to read the tags of the given union type.
|
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.
Extended Type:
|