clojure.core.reducers/monoid

functionsince v0.0-1236 clojure.core.reducers/monoidEdit
(monoid op ctor)

Source docstring:
Builds a combining fn out of the supplied operator and identity
constructor. op must be associative and ctor called with no args
must return an identity value for it.
Source code @ clojurescript:src/main/cljs/clojure/core/reducers.cljs
(defn monoid
  [op ctor]
  (fn m
    ([] (ctor))
    ([a b] (op a b))))