Repository navigation
Releases
Releases · durantschoon/consistent-lib
v0.2.0
Added
- Transducer arities on the sixteen wrappers whose
clojure.corefunction has
one:partition-all,partition-by,take,drop,take-nth,take-while,
drop-while,interpose,remove,map,filter,mapcat,keep,
map-indexed,keep-indexed,replace.(c/map f)returns the same
transducer as(clojure.core/map f). sequence:(sequence coll),(sequence coll xform),
(sequence coll xform & colls).transduce:(transduce coll xform f),(transduce coll xform f init).
With these, a transducer pipeline threads with->:
(-> (range 10) (c/transduce (comp (c/map inc) (c/filter even?)) + 0))
returns30.eduction:(eduction coll & xforms), the transducers following the
collection.(-> (range 10) (c/eduction (c/map inc) (c/filter even?)) vec)
returns[2 4 6 8 10].
Changed
- Wrapper docstrings no longer carry the "Transducer arity not provided"
sentence or the paragraph introducingclojure.core's docstring; a docstring
is now the coll-first note followed byclojure.core's docstring verbatim. (c/map [1 2 3])is now a legal call to the transducer arity (it returns a
transducer that uses the vector as its function) instead of an arity error.
clj-kondo, with the shipped config, no longer reports it; it still reports
wrong-arity calls such as(c/partition [1 2 3]).- The wrapper macro can now place a rest argument where
clojure.coreexpects
it, not only last (internal; no consumer-visible change beyondeduction).