ron-rdt-0.10: Replicated Data Types (RON-RDT)

Safe HaskellNone
LanguageHaskell2010

RON.Data.RGA

Description

Replicated Growable Array (RGA)

Synopsis

Documentation

newtype RGA a Source #

Typed RGA

Constructors

RGA [a] 
Instances
Eq a => Eq (RGA a) Source # 
Instance details

Defined in RON.Data.RGA

Methods

(==) :: RGA a -> RGA a -> Bool #

(/=) :: RGA a -> RGA a -> Bool #

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

Defined in RON.Data.RGA

Methods

showsPrec :: Int -> RGA a -> ShowS #

show :: RGA a -> String #

showList :: [RGA a] -> ShowS #

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

Defined in RON.Data.RGA

Associated Types

type Rep (RGA a) :: Type Source #

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

Defined in RON.Data.RGA

Methods

encoding :: Encoding (RGA a) Source #

type Rep (RGA a) Source # 
Instance details

Defined in RON.Data.RGA

type Rep (RGA a) = RgaRep

data RgaRep Source #

Untyped RGA

Instances
Eq RgaRep Source # 
Instance details

Defined in RON.Data.RGA

Methods

(==) :: RgaRep -> RgaRep -> Bool #

(/=) :: RgaRep -> RgaRep -> Bool #

Show RgaRep Source # 
Instance details

Defined in RON.Data.RGA

Semigroup RgaRep Source # 
Instance details

Defined in RON.Data.RGA

Monoid RgaRep Source # 
Instance details

Defined in RON.Data.RGA

Semilattice RgaRep Source # 
Instance details

Defined in RON.Data.RGA

Reducible RgaRep Source # 
Instance details

Defined in RON.Data.RGA

Methods

reducibleOpType :: UUID Source #

stateFromChunk :: [Op] -> RgaRep Source #

stateToChunk :: RgaRep -> [Op] Source #

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

reduceUnappliedPatches :: Unapplied -> Unapplied Source #

type RgaString = RGA Char Source #

Speciaization of RGA to Char. This is the recommended way to store a string.

edit :: (ReplicatedAsPayload a, ReplicaClock m, MonadE m, MonadObjectState (RGA a) m) => [a] -> m () Source #

Replace content of the RGA throug introducing changes detected by getGroupedDiffBy.

editText :: (ReplicaClock m, MonadE m, MonadObjectState RgaString m) => Text -> m () Source #

Speciaization of edit for Text

getList :: (Replicated a, MonadE m, MonadObjectState (RGA a) m) => m [a] Source #

Read elements from RGA

getText :: (MonadE m, MonadObjectState RgaString m) => m Text Source #

Read characters from RgaString

insert Source #

Arguments

:: (Replicated a, MonadE m, MonadObjectState (RGA a) m, ReplicaClock m) 
=> [a] 
-> Maybe UUID

position

-> m () 

Insert a sequence of elements after the specified position. Position is identified by UUID. Nothing means the beginning.

insertAfter Source #

Arguments

:: (Replicated a, MonadE m, MonadObjectState (RGA a) m, ReplicaClock m) 
=> [a] 
-> UUID

position

-> m () 

insertText Source #

Arguments

:: (ReplicaClock m, MonadE m, MonadObjectState RgaString m) 
=> Text 
-> Maybe UUID

position

-> m () 

Insert a text after the specified position. Position is identified by UUID. Nothing means the beginning.

insertTextAfter Source #

Arguments

:: (ReplicaClock m, MonadE m, MonadObjectState RgaString m) 
=> Text 
-> UUID

position

-> m () 

newFromList :: (Replicated a, MonadState StateFrame m, ReplicaClock m) => [a] -> m (ObjectRef (RGA a)) Source #

Create an RGA from a list

remove Source #

Arguments

:: (MonadE m, MonadObjectState (RGA a) m, ReplicaClock m) 
=> UUID

position

-> m () 

Record a removal of a specific item

rgaType :: UUID Source #

Name-UUID to use as RGA type marker.

toList :: RGA a -> [a] Source #