Return a state-monad function that replaces the current state by the
result of f applied to the current state and that returns the old state.
(defn update-state "Return a state-monad function that replaces the current state by the result of f applied to the current state and that returns the old state." [f] (fn [s] [s (f s)]))
Comments top
No comments for update-state. Log in to add a comment.