takes a regex op re, and predicates. Returns a regex-op that consumes input as per re but subjects the resulting value to the conjunction of the predicates, and any conforming they might perform.
(require '[clojure.spec.alpha :as s]) (s/conform (s/cat :tag keyword? :children (s/& (s/+ integer?) #(-> % count (>= 2)))) [:a 3]) ;=> :clojure.spec.alpha/invalid (s/conform (s/cat :tag keyword? :children (s/& (s/+ integer?) #(-> % count (>= 2)))) [:a 3 4 5]) ;=> {:tag :a, :children [3 4 5]}
clojure.spec.alpha/&
&