Safe Haskell | None |
---|
- data Action
- newtype TextOperation = TextOperation [Action]
- invertOperation :: TextOperation -> Text -> Either String TextOperation
Documentation
An action changes the text at the current position or advances the cursor.
newtype TextOperation Source
An edit on plain text documents. An operation consists of multiple actions that change the document at the current cursor position or advance the cursor. After applying all actions, the cursor must be at the end of the document.
:: TextOperation | An operation. |
-> Text | Document before the operation was applied. |
-> Either String TextOperation |
Computes the inverse of an operation. Useful for implementing undo.