Fork me on GitHub
#funcool
<
2016-04-05
>
luxbock14:04:22

I added a solution that works, but it's not using mlet which I'm trying to use, since I think it's supposed to be equivalent to the do notation as far as I've understood

dialelo18:04:50

(require '[cats.core :as m])
(require '[cats.context :as ctx])
(require '[cats.labs.writer :as w])

(defn halfer [x]
 (ctx/with-context w/context
   (m/mlet [_ (w/tell (str "I just halved " x "!"))]
     (m/return (/ x 2)))))

(halfer 10)

dialelo18:04:34

@luxbock: the above example does what you want

dialelo18:04:48

happy to help