OT v0.1.0 OT.Type behaviour

A behaviour for implementing an operational transformation type.

An operational transformation (OT) type is a module that is able to apply operations on a piece of data in any order and guarantee convergence of the two resulting data states.

Summary

Types

An atom indicating whether the “left” (transforming) operation was received later than the “right” (transformer)

Callbacks

Apply an operation to a datum of the type operated on by the OT type

Compose two operations together into a single operation

Invoked in order to initialize a “blank” datum of the type operated on by the OT type

Transform an operation against another operation

Types

side()
side() :: :left | :right

An atom indicating whether the “left” (transforming) operation was received later than the “right” (transformer).

Callbacks

apply(any, list)
apply(any, list) :: any

Apply an operation to a datum of the type operated on by the OT type.

compose(operation_a, operation_b)
compose(operation_a :: list, operation_b :: list) :: list

Compose two operations together into a single operation.

init()
init() :: any

Invoked in order to initialize a “blank” datum of the type operated on by the OT type.

transform(operation_a, operation_b, side)
transform(operation_a :: list, operation_b :: list, side) :: list

Transform an operation against another operation.