Fork me on GitHub
#clojure-spec
<
2019-10-27
>
kenny23:10:11

Is there a way to write s/ands without having the conformed value passed to the predicate? All of our s/and predicates call s/unform on the value before calling the actual predicate function. This seems unnecessary. For example:

(s/def ::base-metric
  (s/and
    ::metric/metric
    #(metric-bounds-lower-less-than-or-equal-to-upper?
       (s/unform ::base-metric %))
    #(metric-default-value-within-bounds?
       (s/unform ::base-metric %))))