Skip to content

Instantly share code, notes, and snippets.

@sgoguen
Created December 6, 2023 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgoguen/415cff8b7ffeccc23598dbc8e748d983 to your computer and use it in GitHub Desktop.
Save sgoguen/415cff8b7ffeccc23598dbc8e748d983 to your computer and use it in GitHub Desktop.
Person or Cheese - Type Inferencing
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