modify package:fused-effects

Replace the state value with the result of applying a function to the current state value. This is strict in the new state.
modify f = get >>= (put . f $!)
Replace the state value with the result of applying a function to the current state value. This is lazy in the new state; injudicious use of this function may lead to space leaks.
modifyLazy f = get >>= put . f