Commits

Meikel Brandmeyer committed 17915b8

Fixed bug in bind for state monad

* monad/state.clj (bind): In the run-state call for the return value
the intermediate state s1 should be used instead of the initial s0.

Comments (0)

Files changed (1)

src/de/kotka/monad/state.clj

   (return ::type
           (fn [s0]
             (let [[a s1] (run-state m s0)]
-              (run-state (f a) s0)))))
+              (run-state (f a) s1)))))