Public API:
Spec macros for clojure.core.
Public API: Spec macros for clojure.core.
(atom-spec & args)
Example: (atom-spec :read integer? :write integer?)
Generates atoms that accept values conforming to :write (via inputs of reset!, swap! etc.), and provides values conforming to :read (via deref, return of old val in swap-vals! etc.).
:write is contravariant (an input to the atom) and :read is covariant (an output of the atom).
Conforms atoms that deref values conforming to :read. Generates atoms that conform updated values via reset!/swap! etc., to :write.
Defaults:
Example: (atom-spec :read integer? :write integer?) Generates atoms that accept values conforming to :write (via inputs of reset!, swap! etc.), and provides values conforming to :read (via deref, return of old val in swap-vals! etc.). :write is contravariant (an input to the atom) and :read is covariant (an output of the atom). Conforms atoms that deref values conforming to :read. Generates atoms that conform updated values via reset!/swap! etc., to :write. Defaults: - :write any? - :read any?
(reduced-spec s)
Example: (reduced-spec integer?)
Spec that conforms the result of (clojure.core/reduced x) where x is a value of spec s.
Example: (reduced-spec integer?) Spec that conforms the result of (clojure.core/reduced x) where x is a value of spec s.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close