Last active
March 25, 2017 15:07
-
-
Save chpill/4878ad4199cd9d371230772a1d5448c0 to your computer and use it in GitHub Desktop.
dive into transducers - extract from https://github.com/chpill/transducers-deep-dive/blob/a9d158b161fd963cb5c7ba1ab18531b76da8ae08/src/transducers_deep_dive/core.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn error? [x] (:error x)) | |
(defn original [chunks] | |
(transduce (comp | |
(halt-when error?) | |
(map #(frequencies (map :a %)))) | |
(completing (partial merge-with +)) | |
{} | |
chunks)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment