F# Shorthand for mapping over a list of records & grabbing a named value

Viewed 64

I'm mapping over a list of records in F# and grabbing a named value:

type Person = { FirstName: string; LastName: string }

let people = [
    { FirstName = "Whitney"; LastName = "Houston" }
    { FirstName = "Tina"; LastName = "Turner" }
    { FirstName= "Donna"; LastName = "Summer" }
]

people |> List.map (fun person -> person.LastName)

In the Elm language, you can do something like

people |> List.map .LastName

Is some sort of shorthand like that possible in F#?

1 Answers
Related