Return a state-monad function that assumes the state to be a map and
replaces the value associated with key by val. The old value is returned.
(defn set-val "Return a state-monad function that assumes the state to be a map and replaces the value associated with key by val. The old value is returned." [key val] (update-val key (fn [_] val)))
Comments top
No comments for set-val. Log in to add a comment.