undoRedo :: (forall syntax. Mark -> URList -> BufferImpl syntax
             -> (BufferImpl syntax, (URList, [Update])))
         -> BufferM ()
undoRedo f = do
  isTransacPresent <- use updateTransactionInFlightA
  if isTransacPresent
  then error "Can't undo while undo transaction is in progress"
  else do
      m <- getInsMark
      ur <- use undosA
      (ur', updates) <- queryAndModify (f m ur)
      assign undosA ur'
      tell updates
undoRedo :: (forall syntax. Mark -> URList -> BufferImpl syntax
             -> (BufferImpl syntax, (URList, [Update])))
         -> BufferM ()
undoRedo f = do
  isTransacPresent <- use updateTransactionInFlightA
  if isTransacPresent
  then error "Can't undo while undo transaction is in progress"
  else do
      m <- getInsMark
      ur <- use undosA
      (ur', updates) <- queryAndModify (f m ur)
      assign undosA ur'
      tell updates
undoRedo f = do
  isTransacPresent <- use updateTransactionInFlightA
  if isTransacPresent
  then error "Can't undo while undo transaction is in progress"
  else do
      m <- getInsMark
      ur <- use undosA
      (ur', updates) <- queryAndModify (f m ur)
      assign undosA ur'
      tell updates