Extensions Module
Types and nested modules
| Type/Module | Description |
|
|
|
|
|
|
|
|
|
|
A record implementation that allows you to access properties using a property key |
|
|
Get a property key from a mapping function for the given type. |
|
|
|
|
|
Used to represent a type can be any of the types of properties for the given generic. Create a proptypekey with lambdas accessing each of the properties to create a key which statically resolves the actual types of the underlying value. |
|
|
Equivalent to |
Functions and values
| Function or value |
Description
|
Get a property key from a mapping function for the given type.
Example
type Book<'T> =
{ Title: obj }
'T
type LibraryHires =
{
Witcher: int
Dune: int
}
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val makeBook: key: 'a -> Book<LibraryHires>
val key: 'a
val dune: Book<LibraryHires>
Book.Title: obj
|
|
Full Usage:
typekeyof fn
Parameters:
'T -> 'ReturnType
Returns: typekeyof<'T, 'ReturnType>
Modifiers: inline Type parameters: 'T, 'ReturnType |
Equivalent to
|
Active patterns
| Active pattern |
Description
|
Full Usage:
(|KeyIs|_|) value comp
Parameters:
string
comp : keyof<'T>
Returns: bool
Modifiers: inline Type parameters: 'T |
Pattern matching against a property key using strings.
Example
type TestObject =
{
Field1: int
Field2: string
}
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int Multiple items
val string: value: 'T -> string -------------------- type string = System.String val fieldAccessor: obj
|
Full Usage:
(|TypeKeyIs|_|) value comp
Parameters:
string
comp : typekeyof<'T, 'U>
Returns: bool
Modifiers: inline Type parameters: 'T, 'U |
Pattern matching against a type property key using strings.
|