Liking cljdoc? Tell your friends :D

typed.spec.clojure.core

Public API:

Spec macros for clojure.core.

Public API:

Spec macros for clojure.core.
raw docstring

atom-speccljmacro

(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:

  • :write any?
  • :read any?
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?
raw docstring

reduced-speccljmacro

(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.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close