monadic inner modifications and undo/redo