(conformer f)
(conformer f unf)
takes a predicate function with the semantics of conform i.e. it should return either a
(possibly converted) value or :clojure.spec.alpha/invalid, and returns a
spec that uses it as a predicate/conformer. Optionally takes a
second fn that does unform of result of first
Source
(defmacro conformer
"takes a predicate function with the semantics of conform i.e. it should return either a
(possibly converted) value or :clojure.spec.alpha/invalid, and returns a
spec that uses it as a predicate/conformer. Optionally takes a
second fn that does unform of result of first"
([f] `(spec-impl '(conformer ~(res f)) ~f nil true))
([f unf] `(spec-impl '(conformer ~(res f) ~(res unf)) ~f nil true ~unf)))