XanthamFableCore
module XanthamFableCore| Assembly | Xantham.Fable.Core |
| Attributes | [<AutoOpen>] |
Declared inside
Brand | Crossing the brand boundary |
Intersect | Constructing an intersection with an operand F# cannot inherit (Intersect<'A, 'B>) |
KeyOf | |
PropTypeBuilder | |
TypeKeyOf |
Functions and values
keyof<'T, 'ReturnType> (fn: 'T -> 'ReturnType) : keyof<'T>
keyof<'T, 'ReturnType> (fn: 'T -> 'ReturnType) : keyof<'T>Get a property key from a mapping function for the given type.
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"
typekeyof<'T, 'ReturnType> (fn: 'T -> 'ReturnType) : typekeyof<'T,'ReturnType>
typekeyof<'T, 'ReturnType> (fn: 'T -> 'ReturnType) : typekeyof<'T,'ReturnType>Equivalent to keyof but keeps the return type.
Properties
Methods
static member inline Access<'T> (accessedObject: 'T, key: keyof<'T>) : obj optionActive patterns
Extension members
static member inline UnsafeAccess<'T, 'a> (accessedObject: obj, key: keyof<'a>) : obj option