Created
June 10, 2015 15:12
-
-
Save jcf/fb9769ff5e9b5453bd8a to your computer and use it in GitHub Desktop.
Prismatic schema for reference-types (deferrable) like atoms and futures.
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
(defrecord Reference [schema] | |
s/Schema | |
(walker [_] | |
(let [sub-walker (s/subschema-walker schema)] | |
(fn [x] (sub-walker @x)))) | |
(explain [_] (list 'reference (s/explain schema)))) | |
(defn reference | |
[schema] | |
(Reference. schema)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment