Created
November 8, 2018 15:42
-
-
Save honzabrecka/fabec28082c698117fc72700cc79dd76 to your computer and use it in GitHub Desktop.
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 p-pmap | |
[max f result xs] | |
(p/then (->> xs (take max) (map f) p/all) | |
(fn [resolved] | |
(let [result (concat result resolved)] | |
(if (>= (count xs) max) | |
(p-pmap max f result (drop max xs)) | |
result))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment