From a986c44fcec8ba6e8e4d86381b84624e560e7ded Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Sat, 26 Nov 2016 14:28:23 +0200 Subject: [PATCH] cleanup --- dev-src/example/io2.clj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dev-src/example/io2.clj b/dev-src/example/io2.clj index 34e4fb1..754a25e 100644 --- a/dev-src/example/io2.clj +++ b/dev-src/example/io2.clj @@ -11,17 +11,17 @@ (defrecord IOResult [io acc]) (defn run-io! [dispatcher {:keys [io]}] - (map->IOResult - (reduce - (fn [{:keys [io acc]} [action data]] - (let [io-result (k/invoke dispatcher action {:data data, :acc acc})] - (when-not (or (map? io-result) (nil? io-result)) - (throw (ex-info "IO must return a map or nil" {:result io-result}))) - {:io (conj io [action data io-result]) - :acc (merge acc io-result)})) + (reduce + (fn [{:keys [io acc]} [action data]] + (let [io-result (k/invoke dispatcher action {:data data, :acc acc})] + (when-not (or (map? io-result) (nil? io-result)) + (throw (ex-info "IO must return a map or nil" {:result io-result}))) + {:io (conj io [action data io-result]) + :acc (merge acc io-result)})) + (map->IOResult {:io [] - :acc {}} - io))) + :acc {}}) + io)) (defn log! [fmt & args] (apply printf (str "\u001B[35m" fmt "\u001B[0m\n") args))