ron-rdt-0.6: 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 #

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

Defined in RON.Data.RGA

Methods

objectOpType :: UUID Source #

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

getObject :: MonadE m => Object (RGA a) -> m (RGA a) Source #

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

Defined in RON.Data.RGA

Methods

encoding :: Encoding (RGA a) Source #

data RgaRaw Source #

Untyped RGA

Instances
Eq RgaRaw Source # 
Instance details

Defined in RON.Data.RGA

Methods

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

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

Show RgaRaw Source # 
Instance details

Defined in RON.Data.RGA

Semigroup RgaRaw Source # 
Instance details

Defined in RON.Data.RGA

Monoid RgaRaw Source # 
Instance details

Defined in RON.Data.RGA

Reducible RgaRaw Source # 
Instance details

Defined in RON.Data.RGA

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, MonadState (Object (RGA a)) m) => [a] -> m () Source #

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

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

Speciaization of edit for Text

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

Read elements from RGA

getText :: MonadE m => Object RgaString -> m Text Source #

Read characters from RgaString

insert Source #

Arguments

:: (Replicated a, MonadE m, MonadState (Object (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, MonadState (Object (RGA a)) m, ReplicaClock m) 
=> [a] 
-> UUID

position

-> m () 

insertAtBegin :: (Replicated a, MonadE m, MonadState (Object (RGA a)) m, ReplicaClock m) => [a] -> m () Source #

insertText Source #

Arguments

:: (ReplicaClock m, MonadE m, MonadState (Object 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, MonadState (Object RgaString) m) 
=> Text 
-> UUID

position

-> m () 

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

Create an RGA from a list

newFromText :: ReplicaClock m => Text -> m (Object RgaString) Source #

Create an RgaString from a text

remove Source #

Arguments

:: (MonadE m, MonadState (Object (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.