ot-0.1.1.1: Real-time collaborative editing with Operational Transformation

Safe HaskellNone

Control.OperationalTransformation.Text

Synopsis

Documentation

data Action Source

An action changes the text at the current position or advances the cursor.

Constructors

Retain !Int

Skip the next n characters.

Insert !Text

Insert the given text at the current position.

Delete !Int

Delete the next n characters.

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.

Constructors

TextOperation [Action] 

invertOperationSource

Arguments

:: TextOperation

An operation.

-> Text

Document before the operation was applied.

-> Either String TextOperation 

Computes the inverse of an operation. Useful for implementing undo.