 `r/reduce`."
   ([keyfn f coll]
      (let [sentinel (Object.)]
-       (->> (r/mapcat identity [coll [sentinel]])
+       (->> (concat coll [sentinel])
             (tr/map-state (fn [[k acc] x]
                             (if (identical? sentinel x)
                               [nil acc]

  ([f coll] (reductions f (f) coll))
  ([f init coll]
     (let [sentinel (Object.)]
       (->> (r/mapcat identity [coll [sentinel]])
            (tr/map-state (fn [acc x]
                            (if (identical? sentinel x)
                              [nil acc]

(ns parkour.reducers
  (:refer-clojure
   , :exclude [concat map-indexed reductions distinct count first keep])
  (:require [clojure.core :as cc]
            [clojure.core.reducers :as r]
            [clojure.core.protocols :as ccp]
            [transduce.reducers :as tr]
            [parkour.util :refer [returning]])
  (:import [java.util Random]))

(defn concat
  "Reducers version of `concat`."
  [& colls] (r/mapcat identity colls))

(defn map-indexed
  "Reducers version of `map-indexed`."
