Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class MonadUpdateEF o p e (m :: Type -> Type) | m -> o p e where
- event :: e -> m (Output e, EventId p)
- fullMerge :: EventFold o p e -> m (Either (MergeError o p e) ())
- diffMerge :: Diff o p e -> m (Either (MergeError o p e) ())
- participate :: p -> m (EventId p)
- disassociate :: p -> m (EventId p)
- getResult :: m (UpdateResult o p e)
- class Monad m => MonadInspectEF o p e (m :: Type -> Type) | m -> o p e where
- data EventFoldT o p e (m :: Type -> Type) a
- runEventFoldT :: Ord p => p -> EventFold o p e -> EventFoldT o p e m a -> m (a, UpdateResult o p e)
Documentation
class MonadUpdateEF o p e (m :: Type -> Type) | m -> o p e where Source #
The interface for monadically updating an EventFold, where the monadic context is intended to manage:
- The local participant.
- The current state of the EventFold.
- The accumulated consistent outputs.
- Whether the
EventFold
needs to be propagated to other participants.
event :: e -> m (Output e, EventId p) Source #
Apply an event. See event
.
fullMerge :: EventFold o p e -> m (Either (MergeError o p e) ()) Source #
Perform a full merge. See fullMerge
.
diffMerge :: Diff o p e -> m (Either (MergeError o p e) ()) Source #
Perform a diff merge. See diffMerge
.
participate :: p -> m (EventId p) Source #
Allow a new participant to join in the cluster. See participate
.
disassociate :: p -> m (EventId p) Source #
Remove a peer from participation. See disassociate
.
getResult :: m (UpdateResult o p e) Source #
Get the outstanding update results.
Instances
(Eq (Output e), Eq e, Eq o, Event p e, Monad m, Ord p) => MonadUpdateEF o p e (EventFoldT o p e m) Source # | |
Defined in Data.CRDT.EventFold.Monad event :: e -> EventFoldT o p e m (Output e, EventId p) Source # fullMerge :: EventFold o p e -> EventFoldT o p e m (Either (MergeError o p e) ()) Source # diffMerge :: Diff o p e -> EventFoldT o p e m (Either (MergeError o p e) ()) Source # participate :: p -> EventFoldT o p e m (EventId p) Source # disassociate :: p -> EventFoldT o p e m (EventId p) Source # getResult :: EventFoldT o p e m (UpdateResult o p e) Source # |
class Monad m => MonadInspectEF o p e (m :: Type -> Type) | m -> o p e where Source #
Interface for inspecting an Eventfold contained within the monadic context.
Nothing
Instances
Monad m => MonadInspectEF o p e (EventFoldT o p e m) Source # | |
Defined in Data.CRDT.EventFold.Monad efAsks :: (EventFold o p e -> a) -> EventFoldT o p e m a Source # efAsk :: EventFoldT o p e m (EventFold o p e) Source # |
data EventFoldT o p e (m :: Type -> Type) a Source #
A transformer providing MonadUpdateEF
and MonadInspectEF
.
Instances
:: Ord p | |
=> p | The local participant. |
-> EventFold o p e | Initial event fold value. |
-> EventFoldT o p e m a | The action to run. |
-> m (a, UpdateResult o p e) | Returns the result of the action, plus all the accumulated
|