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

Safe HaskellSafe-Inferred
LanguageHaskell98

Control.OperationalTransformation

Synopsis

Documentation

class OTOperation op where Source

Methods

transform :: op -> op -> Either String (op, op) Source

Transforms two concurrent operations a and b, producing a' and b' such that b' ∘ a == a' ∘ b.

class OTOperation op => OTComposableOperation op where Source

Methods

compose :: op -> op -> Either String op Source

Composes two operations a and b, producing c, such that c has the same effect when applied to a document as applying a and b one after another.

class OTCursor cursor op where Source

Cursor position

Methods

updateCursor :: op -> cursor -> cursor Source

Instances

OTCursor () op 
OTCursor Selection TextOperation 
OTCursor Range TextOperation 
OTCursor cursor op => OTCursor [cursor] op 
(OTCursor a op, OTCursor b op) => OTCursor (a, b) op 
(OTCursor a op, OTCursor b op, OTCursor c op) => OTCursor (a, b, c) op 
(OTCursor a op, OTCursor b op, OTCursor c op, OTCursor d op) => OTCursor (a, b, c, d) op 
(OTCursor a op, OTCursor b op, OTCursor c op, OTCursor d op, OTCursor e op) => OTCursor (a, b, c, d, e) op 

class OTOperation op => OTSystem doc op where Source

Methods

apply :: op -> doc -> Either String doc Source

Apply an operation to a document, producing a new document.

Instances

OTSystem Text TextOperation 
OTSystem doc op => OTSystem doc [op] 
(OTSystem doca a, OTSystem docb b) => OTSystem (doca, docb) (a, b) 
(OTSystem doca a, OTSystem docb b, OTSystem docc c) => OTSystem (doca, docb, docc) (a, b, c) 
(OTSystem doca a, OTSystem docb b, OTSystem docc c, OTSystem docd d) => OTSystem (doca, docb, docc, docd) (a, b, c, d) 
(OTSystem doca a, OTSystem docb b, OTSystem docc c, OTSystem docd d, OTSystem doce e) => OTSystem (doca, docb, docc, docd, doce) (a, b, c, d, e)