
Import namespaces:

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

Define function:

(def sum (fn [nums]
           (reduce (fn [acc val] (m/mlet [a acc] (m/return (+ a val))))
           (state/put-state 0) nums)))

Run the state monad:

(state/run-state (sum (repeat 15900 2)) 0)

Add test doc for reproduce the stack overflow.
Add  test doc for reproduce the stack overflow.
