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

Safe HaskellNone
LanguageHaskell98

Control.OperationalTransformation.Text

Contents

Synopsis

Simple text operations

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] 

invertOperation Source

Arguments

:: TextOperation

An operation

-> Text

Document to apply the operation to

-> Either String TextOperation 

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