Last active
December 12, 2015 03:18
-
-
Save swannodette/4705272 to your computer and use it in GitHub Desktop.
This file contains 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
(unifier/unify | |
{:as '{?x (?y ?z)} | |
:constraints {'?z (fnc [n] (number? n))} | |
'(?x ?a) '(["foo" 9] [1 2 3])) | |
;; previously you couldn't name '(?y ?z) | |
(unifier/unify | |
{:constraints {'?z (fnc [n] (number? n)}} | |
'((?y ?z) ?a) '(["foo" 9] [1 2 3])) | |
;; if vector, we want a constraint that involve two or more vars | |
;; if set, we want to apply a constraint individually | |
(unifier/unify | |
{:constraints {'[?y ?z] (fnc [y z] ... #_(something about y & z) ...) | |
'#{?y ?z} (fnc [n] (number? n))}} | |
'((?y ?z) ?a) '(["foo" 9] [1 2 3])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment