Liking cljdoc? Tell your friends :D

Changelog

All notable changes to this project are documented here. The format follows Keep a Changelog, and the project uses Semantic Versioning.

Unreleased

0.2.0 - 2026-12-02

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).

0.1.0 - 2026-12-02

First release, published as io.github.durantschoon/consistent-lib.

Added

  • consistent-lib.core: 34 collection-first wrappers for clojure.core sequence functions. Each one behaves exactly like the clojure.core function of the same name, with the primary collection moved to argument 1 (any further collections stay after the function, in core's order):
    • splitting and chunking: partition, partition-all, partition-by, split-at, split-with, group-by;
    • taking and dropping: take, drop, take-nth, take-while, drop-while, take-last, drop-last;
    • transforming: map, mapv, map-indexed, mapcat, filter, filterv, remove, keep, keep-indexed, replace, sort, sort-by, interpose;
    • reducing: reduce, reductions, reduce-kv, run!;
    • predicates: some, every?, not-every?, not-any?.
  • A function is wrapped only when clojure.core does not already take its primary collection first, so concat, interleave and subvec are not wrapped.
  • Every non-transducer arity of each wrapped function is covered. Multi-collection functions take the first collection, then the function, then the other collections: (map coll f c2 c3 & colls), (mapcat coll f & colls).
  • Each wrapper's docstring opens with a consistent-lib note and then gives the clojure.core docstring verbatim; its :arglists show the collection-first order.
  • ClojureScript support: consistent-lib.core is .cljc and delegates to cljs.core in ClojureScript.
  • A clj-kondo config in the jar (clj-kondo.exports/io.github.durantschoon/consistent-lib), with a hook that gives consumers arity checking on wrapper calls.
  • Requires Clojure 1.10.3 or later. The pom's Clojure dependency is 1.10.3, the lowest version the test suite passes on; CI runs the JVM tests on both 1.10.3 and 1.12.3.
  • Loading the library never checks the wrapped functions' arities against the Clojure version in use, so a newer Clojure that adds an arity to a wrapped function cannot stop a consumer's build; that check runs only in this repo's own tests.

Not included

  • Transducer arities (for example (map f)); use clojure.core directly for transducers. The affected wrappers say so in their docstrings.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close