clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
kenny 2020-02-01T22:28:55.129600Z

Should spec2's s/select work for collections of collections? I would think this would return false.

(s2/def ::coll-next (s2/coll-of (s2/coll-of (s2/schema [::a]))))
(s2/def ::map (s2/schema [::coll-next]))
(s2/valid?
    (s2/select ::map [::coll-next {::coll-next [::a]}])
    {::coll-next [[]]})
=> true

seancorfield 2020-02-01T23:15:19.130300Z

Given that ::coll-next is a collection, not a schema, I'm not sure how that should work...?