(ensure-step value)
Internal use only.
Given a state-flow step, returns value as/is, else wraps value in a state-flow step.
Internal use only. Given a state-flow step, returns value as/is, else wraps value in a state-flow step.
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 & args)
Returns the equivalent of (fn [state] [state, (apply swap! state f args)])
Returns the equivalent of (fn [state] [state, (apply swap! state f args)])
(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