Skip to content

Instantly share code, notes, and snippets.

@voronoipotato
Created February 5, 2023 03:54
Show Gist options
  • Select an option

  • Save voronoipotato/3a79de266f75a93276ad1cb330e944b9 to your computer and use it in GitHub Desktop.

Select an option

Save voronoipotato/3a79de266f75a93276ad1cb330e944b9 to your computer and use it in GitHub Desktop.
type ICounts() =
static member inline Count< ^C when ^C: (member itemCount: int)> o = (^C: (member itemCount: int) o)
static member inline Count< ^C, 'Dummy1 when ^C: (member thingCount: int)> o = (^C: (member thingCount: int) o)
static member inline Count< ^C, 'Dummy1, 'Dummy2 when ^C: (member otherCount: int)> o = (^C: (member otherCount: int) o)
static member inline Count< ^C, 'Dummy1, 'Dummy2, 'Dummy3 when ^C: (member Count: int)> o = (^C: (member Count: int) o)
let say count =
printfn "%d" count
()
type c = ICounts
say (c.Count {|itemCount = 1|})
say (c.Count {|thingCount = 2|})
say (c.Count {|otherCount = 3|})
say (c.Count {|Count = 4|})
{
"version": 1,
"target": "Run",
"mode": "Debug"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment