How would you do this example from algo.monads using cats? https://github.com/clojure/algo.monads/blob/master/src/examples/clojure/examples/monads.clj#L145
I can see how to make it work using :let and explicit get/put-state, was wondering if there was an implementation with similar abstraction as the one in algo.monads.
In particular referring to the use of reduce.