text_delta v1.0.1 TextDelta.Delta.Transformation

The transformation of two concurrent operations such that they satisfy the convergence properties of Operational Transformation.

Transformation allows optimistic conflict resolution in concurrent editing. Given an operation A that occurred at the same time as operation B against the same text state, we can transform the components of operation A such that the state of the text after applying operation A and then operation B is the same as after applying operation B and then the transformation of operation A against operation B:

S ○ Oa ○ transform(Ob, Oa) = S ○ Ob ○ transform(Oa, Ob)

Transformation also takes a third t:TextDelta.Delta.Transformation.priority argument that indicates which operation came later. This is important when deciding whether it is acceptable to break up insert operations from one operation or the other.

There is a great article writte on Operational Transformation that author of this library used. It is called Understanding and Applying Operational Transformation.

Summary

Types

Atom representing transformation priority. Should we prioritise left or right side?

Functions

Transforms given delta_b against given delta_a

Types

priority()
priority() :: :left | :right

Atom representing transformation priority. Should we prioritise left or right side?

Functions

transform(delta_a, delta_b, priority)

Transforms given delta_b against given delta_a.