Skip to content

Instantly share code, notes, and snippets.

Created December 2, 2009 12:24
What would you like to do?
;variants of the code from point #2 of:
(apply merge-with +
(pmap count-lines
(partition-all *batch-size*
(line-seq (reader filename)))))
;pipelined style
(->> (line-seq (reader filename))
(partition-all *batch-size*)
(pmap count-lines)
(apply merge-with +))
;step-wise, with labeled interim results
(let [lines (line-seq (reader filename))
processed-data (pmap count-lines
(partition-all *batch-size* lines))]
(apply merge-with + processed-data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment