Skip to content

Releases

v0.2.0

Choose a tag to compare

@durantschoon durantschoon released this 03 Dec 00:50
v0.2.0
503ac48

Added

  • Transducer arities on the sixteen wrappers whose clojure.core function 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))
    returns 30.
  • 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 introducing clojure.core's docstring; a docstring
    is now the coll-first note followed by clojure.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.core expects
    it, not only last (internal; no consumer-visible change beyond eduction).