persistent-eventsource-0.2.0: Persistent based event sourcing.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Persistent.EventSource.Aggregate

Synopsis

Documentation

class Projection a => Aggregate a where Source #

Aggregate is an intermediate step, allowing you to specify how your changeable commands are stored. stored events should be stable like an API.

Associated Types

type Command a = cmd | cmd -> a Source #

The command is a sumtype with all your possible event sourced actions.

type Actor a Source #

allows you to specify who executed a command. for audit purposes. set this to () if you don't care about this.

Methods

act :: (MonadSqlQuery m, MonadIO m) => Maybe (Actor a) -> Command a -> m [Event a] Source #

Validate action and generate events, if any.