keyof
type keyof<'T> =
| Value__ of string| Assembly | Xantham.Fable.Core |
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"
Cases
Value__ of stringProperties
member inline Value: string