           ([ret k v]
              (f1 ret (f k v)))))))
 
+(defcurried mapcat
+  "Applies f to every value in the reduction of coll, concatenating the result
+  colls of (f val). Foldable."
+  {}
+  [f coll]
+  (folder coll
+   (fn [f1]
+     (rfn [f1 k]
+          ([ret k v]
+             (reduce f1 ret (f k v)))))))
+
 (defcurried filter
   "Retains values in the reduction of coll for which (pred val)
   returns logical true. Foldable."

      dependency info."
      :author "Rich Hickey"}
  clojure.core.reducers
  (:refer-clojure :exclude [reduce map filter remove take take-while drop flatten])
  (:require [clojure.walk :as walk]
            [cljs.core :as core]))


             (if (pred k v)
               (f1 ret k v)
               ret))))))

(defcurried flatten
  "Takes any nested combination of sequential things (lists, vectors,
  etc.) and returns their contents as a single, flat foldable
  collection."
  {}
  [coll]
  (folder coll
   (fn [f1]
     (fn
       ([] (f1))
       ([ret v]
          (if (sequential? v)
            (-reduce (flatten v) f1 ret)
            (f1 ret v)))))))

(defcurried remove
  "Removes values in the reduction of coll for which (pred val)
