| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell98 | 
Control.OperationalTransformation.Client
- data ClientState op
- = ClientSynchronized
 - | ClientWaiting op
 - | ClientWaitingWithBuffer op op
 
 - initialClientState :: ClientState op
 - applyClient :: OTComposableOperation op => ClientState op -> op -> Either String (Bool, ClientState op)
 - applyServer :: OTComposableOperation op => ClientState op -> op -> Either String (op, ClientState op)
 - serverAck :: ClientState op -> Maybe (Maybe op, ClientState op)
 
Documentation
data ClientState op Source
At every moment, the client is in one of three states.
Constructors
| ClientSynchronized | All of the client's operations have been acknowledged by the server.  | 
| ClientWaiting op | The client has sent an operation to the server and it is still waiting for an acknowledgement.  | 
| ClientWaitingWithBuffer op op | The client is waiting for an acknowledgement for a pending operation and the client is buffering local changes.  | 
Instances
| Eq op => Eq (ClientState op) | |
| Read op => Read (ClientState op) | |
| Show op => Show (ClientState op) | 
initialClientState :: ClientState op Source
The state a newly connected client starts in (synonym for
 ClientSynchronized).
Arguments
| :: OTComposableOperation op | |
| => ClientState op | |
| -> op | The operation the user has performed on the local document.  | 
| -> Either String (Bool, ClientState op) | Whether to send the operation to the server and the new client state (or an error).  | 
Handle user-generated operations.
Arguments
| :: OTComposableOperation op | |
| => ClientState op | |
| -> op | |
| -> Either String (op, ClientState op) | The transformed operation that must be applied to local document and the new state (or an error).  | 
Handle incoming operations from the server.
Arguments
| :: ClientState op | |
| -> Maybe (Maybe op, ClientState op) | An optional operation that must be sent to the server if present and the new state.  | 
Handle acknowledgements.