Same as state monad context, but short circuits if error happens, place error in return value
Same as state monad context, but short circuits if error happens, place error in return value
(get)
Returns the equivalent of (fn [state] [state, state])
Returns the equivalent of (fn [state] [state, state])
(modify f)
Returns the equivalent of (fn [state] [state, (swap! state f)])
Returns the equivalent of (fn [state] [state, (swap! state f)])
(put new-state)
Returns the equivalent of (fn [state] [state, new-state])
Returns the equivalent of (fn [state] [state, new-state])
(return v)
Returns the equivalent of (fn [state] [v, state])
Returns the equivalent of (fn [state] [v, state])
(wrap-fn my-fn)
Wraps a (possibly side-effecting) function to a state monad
Wraps a (possibly side-effecting) function to a state monad
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close