Skip to content

Instantly share code, notes, and snippets.

View janherich's full-sized avatar

Jan Herich janherich

View GitHub Profile
@janherich
janherich / functional_proposal.clj
Last active May 30, 2018 12:40
Purely functional proposal
;; Rather then relying on macros, I propose to have `merge-fx` helper exposed as function
;; taking variable number of arguments (where the first one is always cofx, second one could
;; be initial effects map and then variable number of effects producing functions, with the
;; all of them with the same form as now:
(defn effects-fn [arg1 arg2 {:keys [db] :as cofx}]
{:db (update db :some-key arg1)
:http-call ...})
(defn final-effects-fn [cofx]
(merge-fx cofx