Like modifyM,
but add two functions filter new state and return value.
This is handy when function return result including state.
Example, state is (a,b), and function return (a,b,c),
then you can write: result <- modifyM_ f fst snd.