1.2.0 permalink Arrow_down_16x16
  • (set-state s)
Return a state-monad function that replaces the current state by s and
returns the previous state.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/monads.clj:353 top

(defn set-state
  "Return a state-monad function that replaces the current state by s and
   returns the previous state."
  [s]
  (update-state (fn [_] s)))
Vars in clojure.contrib.monads/set-state: defn fn
Used in 0 other vars

Comments top

No comments for set-state. Log in to add a comment.