Skip to content

Instantly share code, notes, and snippets.

@v2m
Created April 24, 2013 22:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v2m/5456186 to your computer and use it in GitHub Desktop.
Save v2m/5456186 to your computer and use it in GitHub Desktop.
// have no idea what exact type should look like
type Node = { Reference : int }
let mkArgs0 (target : Node) (source : Node) = dict ["n", box target.Reference; "m", box source.Reference]
// symbolic operators FTW
let (=>) (a : string) b = a, box b
let mkArgs1_1 (target : Node) (source : Node) = dict ["n" => target.Reference; "m" => source.Reference]
let (!) = box
let mkArgs1_2 (target : Node) (source : Node) = dict ["n", !target.Reference; "m", !source.Reference]
// for quote-haters
type V = V with static member (?<-)(V, name : string, value) = name, box value
let mkArgs2 (target : Node) (source : Node) = dict [V?n <- target.Reference; V?m <- source.Reference]
let (?) value name = name, box value
let mkArgs3 (target : Node) (source : Node) = dict [target.Reference?n; source.Reference?m]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment