(coll-of pred & opts)
Returns a spec for a collection of items satisfying pred. Unlike
'every', coll-of will exhaustively conform every value.
Same options as 'every'. conform will produce a collection
corresponding to :into if supplied, else will match the input collection,
avoiding rebuilding when possible.
See also - every, map-of
Source
(defmacro coll-of
"Returns a spec for a collection of items satisfying pred. Unlike
'every', coll-of will exhaustively conform every value.
Same options as 'every'. conform will produce a collection
corresponding to :into if supplied, else will match the input collection,
avoiding rebuilding when possible.
See also - every, map-of"
[pred & opts]
(let [desc `(coll-of ~(res pred) ~@(res-kind opts))]
`(every ~pred ::conform-all true ::describe '~desc ~@opts)))