Logo Xantham

keyof<'T> Type

Get a property key from a mapping function for the given type.

Example

 type Book<'T> = { Title: keyof<'T> }
 type LibraryHires = {
     Witcher: int
     Dune: int
 }
 let makeBook (key: keyof<LibraryHires>): Book<LibraryHires> = {
     Title = key
 }
 let dune = makeBook (keyof<_> _.Dune)
 dune.Title.Value // "Dune"
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

Instance members

Instance member Description

this.Invoke

Full Usage: this.Invoke

Parameters:
    obj : 'T

Returns: obj option
Modifiers: inline
obj : 'T
Returns: obj option

this.Value

Full Usage: this.Value

Returns: string
Modifiers: inline
Returns: string

Static members

Static member Description

keyof.Access(accessedObject, key)

Full Usage: keyof.Access(accessedObject, key)

Parameters:
    accessedObject : 'T
    key : keyof<'T>

Returns: obj option
Modifiers: inline
accessedObject : 'T
key : keyof<'T>
Returns: obj option

keyof.UnsafeAccess(accessedObject, key)

Full Usage: keyof.UnsafeAccess(accessedObject, key)

Parameters:
    accessedObject : obj
    key : keyof<'a>

Returns: obj option
Modifiers: inline
accessedObject : obj
key : keyof<'a>
Returns: obj option

keyof.UnsafeCastFrom(value)

Full Usage: keyof.UnsafeCastFrom(value)

Parameters:
Returns: keyof<'T>
Modifiers: inline
value : keyof<obj>
Returns: keyof<'T>

keyof.UnsafeCastReturnType(key)

Full Usage: keyof.UnsafeCastReturnType(key)

Parameters:
Returns: typekeyof<'T, 'ReturnType>
Modifiers: inline
key : keyof<'T>
Returns: typekeyof<'T, 'ReturnType>

keyof.op_Implicit key

Full Usage: keyof.op_Implicit key

Parameters:
Returns: keyof<'T>
Modifiers: inline
key : typekeyof<'T, 'a>
Returns: keyof<'T>

Type something to start searching.