Created
April 24, 2013 22:38
-
-
Save v2m/5456186 to your computer and use it in GitHub Desktop.
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
// 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