Fork me on GitHub
#funcool
<
2021-03-24
>
Ian Fernandez12:03:56

There would be any motivation to build such thing using cats as:

(require '[cats.core :as m]
         '[cats.monad.either :as me])

(defmacro flow->
  [state & forms]
  `(m/>>=
    (me/right ~state)
    ~@(for [form forms]
        (if (seq? form)
          `(fn [~'x] (~(first form) ~'x ~@(rest form)))
          form))))