Created
August 16, 2017 17:33
-
-
Save saulshanabrook/91ad9bffc35e75b86b555c28f924f658 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
(s/def ::edge-fn fn?) | |
(s/def ::input (s/coll-of keyword?)) | |
(s/def ::output (s/coll-of keyword?)) | |
(s/def ::edge (s/keys :req [::edge-fn ::input ::output])) | |
(s/def ::dynamic-edge-fn (s/fn :ret ::edge)) | |
(s/def ::dynamic-edge (s/keys :req [::dynamic-edge-fn ::input])) | |
(s/def ::graph (s/coll-of (s/or ::edge ::dynamic-edge))) | |
(s/def ::state | |
(s/and | |
(s/map-of keyword? any?) | |
#(s/valid? (eval `(s/keys :req [~@(keys %)])) | |
%))) | |
(s/def ::outputs (s/coll-of keyword?)) | |
(s/fdef run | |
:args (s/cat :graph ::graph | |
:state ::state | |
:outputs ::outputs) | |
:ret ::state | |
:fn (every? (partial contains? (:ret %)) (-> % :args :outputs))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment