sebastiaanvisser/fclabels — pull request #17 by nikita-volkov (2013-03-02 14:04:08+00:00)
Title: Add "modifyAndGet"

For explanation of motivation here's an excerpt from docs on this function:

>
Modify a value with a state-function and get the result of this function. Can be conveniently used with a State monad with help of a runState function:
```haskell
modifyAndGet lens $ runState $ do
currentValue <- get
let newValue = computeNewValueBasedOnCurrentValue currentValue
put $ newValue
return newValue
```