Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class ReadModel p where
- class ReadModel p => WriteModel p where
- transactionalUpdate :: forall m a. MonadUnliftIO m => p -> (Model p -> m (Model p -> a, [Event p])) -> m a
- data Stored a = Stored {
- storedEvent :: a
- storedTimestamp :: UTCTime
- storedUUID :: UUID
- mkId :: MonadIO m => m UUID
- toStored :: MonadIO m => e -> m (Stored e)
Documentation
class ReadModel p where Source #
applyEvent :: p -> Model p -> Stored (Event p) -> Model p Source #
getModel :: p -> IO (Model p) Source #
getEventList :: p -> IO [Stored (Event p)] Source #
getEventStream :: p -> SerialT IO (Stored (Event p)) Source #
Instances
class ReadModel p => WriteModel p where Source #
transactionalUpdate :: forall m a. MonadUnliftIO m => p -> (Model p -> m (Model p -> a, [Event p])) -> m a Source #
Instances
WriteModel (ForgetfulInMemory model e) Source # | |
Defined in DomainDriven.Persistance.ForgetfulInMemory transactionalUpdate :: MonadUnliftIO m => ForgetfulInMemory model e -> (Model (ForgetfulInMemory model e) -> m (Model (ForgetfulInMemory model e) -> a, [Event (ForgetfulInMemory model e)])) -> m a Source # | |
(ToJSON e, FromJSON e) => WriteModel (PostgresEvent m e) Source # | |
Defined in DomainDriven.Persistance.Postgres.Internal transactionalUpdate :: MonadUnliftIO m0 => PostgresEvent m e -> (Model (PostgresEvent m e) -> m0 (Model (PostgresEvent m e) -> a, [Event (PostgresEvent m e)])) -> m0 a Source # |
Wrapper for stored data This ensures all events have a unique ID and a timestamp, without having to deal with that when implementing the model.
Stored | |
|