doText :: T.Text -> [Token] -> T.Text
doText src ts =
  let ls = V.fromList $ L.reverse $ snd $ T.foldl' f (-1, [-1]) src
      result = L.foldl' (foldText ls src) ((1, 1), T.empty) ts
      lastOff = toOffset ls (fst result)
      end = T.drop (lastOff + 1) src
  in
    snd result <> end
doText :: T.Text -> [Token] -> T.Text
doText src ts =
  let ls = V.fromList $ L.reverse $ snd $ T.foldl' f (-1, [-1]) src
      result = L.foldl' (foldText ls src) ((1, 1), T.empty) ts
      lastOff = toOffset ls (fst result)
      end = T.drop (lastOff + 1) src
  in
    snd result <> end
doText src ts =
  let ls = V.fromList $ L.reverse $ snd $ T.foldl' f (-1, [-1]) src
      result = L.foldl' (foldText ls src) ((1, 1), T.empty) ts
      lastOff = toOffset ls (fst result)
      end = T.drop (lastOff + 1) src
  in
    snd result <> end