ron-0.2: RON, RON-RDT, and RON-Schema

Safe HaskellNone
LanguageHaskell2010

RON.Data

Description

Typed and untyped RON tools

Synopsis

Documentation

class (Eq a, Monoid a) => Reducible a where Source #

Untyped-reducible types. Untyped means if this type is a container then the types of data contained in it is not considered.

Minimal complete definition

reducibleOpType, stateFromChunk, stateToChunk

Methods

reducibleOpType :: UUID Source #

UUID of the type

stateFromChunk :: [Op] -> a Source #

Load a state from a state chunk

stateToChunk :: a -> StateChunk Source #

Store a state to a state chunk

applyPatches :: a -> Unapplied -> (a, Unapplied) Source #

Merge a state with patches and raw ops

reduceUnappliedPatches :: Unapplied -> Unapplied Source #

Merge patches and raw ops into bigger patches or throw obsolete ops

class Replicated a where Source #

Base class for typed encoding

Methods

encoding :: Encoding a Source #

Instances SHOULD implement encoding either as objectEncoding or as payloadEncoding

Instances
Replicated Bool Source # 
Instance details

Defined in RON.Data.Internal

Replicated Char Source # 
Instance details

Defined in RON.Data.Internal

Replicated Int64 Source # 
Instance details

Defined in RON.Data.Internal

Replicated Text Source # 
Instance details

Defined in RON.Data.Internal

Replicated Day Source # 
Instance details

Defined in RON.Data.Time

Replicated UUID Source # 
Instance details

Defined in RON.Data.Internal

Replicated VersionVector Source # 
Instance details

Defined in RON.Data.VersionVector

Replicated a => Replicated (Maybe a) Source # 
Instance details

Defined in RON.Data.Internal

Replicated a => Replicated (RGA a) Source # 
Instance details

Defined in RON.Data.RGA

Methods

encoding :: Encoding (RGA a) Source #

ReplicatedAsObject a => Replicated (ObjectORSet a) Source # 
Instance details

Defined in RON.Data.ORSet

ReplicatedAsPayload a => Replicated (ORSet a) Source # 
Instance details

Defined in RON.Data.ORSet

class ReplicatedAsObject a where Source #

Instances of this class are encoded as objects. An enclosing object's payload will be filled with this object's id.

Methods

objectOpType :: UUID Source #

UUID of the type

newObject :: ReplicaClock m => a -> m (Object a) Source #

Encode data

getObject :: Object a -> Either String a Source #

Decode data

class ReplicatedAsPayload a where Source #

Instances of this class are encoded as payload only.

Methods

toPayload :: a -> [Atom] Source #

Encode data

fromPayload :: [Atom] -> Either String a Source #

Decode data

fromRon :: Replicated a => [Atom] -> StateFrame -> Either String a Source #

Decode typed data from a payload. The implementation may use other objects in the frame to resolve references.

newRon :: (Replicated a, ReplicaClock m) => a -> WriterT StateFrame m [Atom] Source #

Encode typed data to a payload with possible addition objects

objectEncoding :: ReplicatedAsObject a => Encoding a Source #

Standard implementation of Replicated for ReplicatedAsObject types.

payloadEncoding :: ReplicatedAsPayload a => Encoding a Source #

Standard implementation of Replicated for ReplicatedAsPayload types.

reduceObject :: Object a -> Object a -> Either String (Object a) Source #

Reduce object with frame from another version of the same object.