Created
December 6, 2023 00:46
-
-
Save sgoguen/415cff8b7ffeccc23598dbc8e748d983 to your computer and use it in GitHub Desktop.
Person or Cheese - Type Inferencing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Person = { Name: string; Age: int } | |
type Cheese = { Name : string; Age : int } | |
let people = [ | |
{ Name = "Brie"; Age = 30 } | |
{ Name = "Colby"; Age = 20 } | |
{ Name = "Jack"; Age = 40 } ] | |
let printName thing = thing |> _.Name |> printfn "%s" | |
people[0] |> printName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment