Curious - why does the Spec form for s/double-in return a s/and with a series of predicates attached for each option passed (e.g., :min, :max, etc), and something like s/every does not include the https://github.com/clojure/spec.alpha/blob/13bf36628eb02904155d0bf0d140f591783c51af/src/main/clojure/clojure/spec/alpha.clj#L558-L567?
(s/form (s/double-in :min 2))
=> (clojure.spec.alpha/and clojure.core/double? (clojure.core/fn [%] (clojure.core/<= 2 %)))
(s/form (s/every string? :min-count 2))
=> (clojure.spec.alpha/every clojure.core/string? :min-count 2) This is a limitation of how double-in is written as a composite but without custom form support. This has actually been addressed in spec 2 (not sure if this particular one has been fixed there but it could be)
Ok. So the desired output for s/double-in's (and its ilk) form would be similar to that of s/every -- returning the kv options passed to the form instead of the composite?
yep, I think the s/form should reproduce the original not expose how it's implemented
spec-alpha2 % clj
Clojure 1.10.1
user=> (require '[clojure.alpha.spec :as s])
nil
user=> (s/form (s/double-in :min 2))
(clojure.alpha.spec/double-in :min 2)Makes sense. Thanks for the response.