Skip to content

Instantly share code, notes, and snippets.

@palladin
Last active September 25, 2021 17:52
Show Gist options
  • Save palladin/e9aa83ea02588ed43bcb to your computer and use it in GitHub Desktop.
Save palladin/e9aa83ea02588ed43bcb to your computer and use it in GitHub Desktop.
Overload
type Term<'a>() = class end
type Tuples' = Tuples' with
static member inline (?<-) (_ : Tuples', _ : (Term<_> * Term<_>), _ : (Term<_> * Term<_>)) = 2
static member inline (?<-) (_ : Tuples', a:Term<_>, b : Term<_>) = 4
static member inline (?<-) (_ : Tuples', a:bool, b:bool) = 3
static member inline (?<-) (_ : Tuples', a:string, b:string) = 1
let inline call_2 (t:^t,a:^a,b:^b) : int =
(t ? (a) <- b )
let t = call_2 (Tuples',Term<int>(),Term<int>())
let t2 = call_2 (Tuples',(Term<int>(),Term<int>()),(Term<int>(),Term<int>()))
let t3 = call_2 (Tuples', true, false)
let inline call a b : int =
call_2 (Tuples', a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment