event-monad-0.0.3: Event-graph simulation monad transformer




data EventT t m a Source

A monad transformer which adds an event queue and related operations to an underlying monad. The "t" parameter specifies the type of the simulation time.

Several hooks are provided to allow special handling of various events, such as the progression of time, the scheduling or canceling or dispatch of an event, etc.


MonadError e m => MonadError e (EventT t m) 
MonadReader r m => MonadReader r (EventT t m) 
MonadState s m => MonadState s (EventT t m) 
MonadWriter w m => MonadWriter w (EventT t m) 
MonadTrans (EventT t) 
Monad m => Monad (EventT t m) 
Functor m => Functor (EventT t m) 
(Typeable t, Typeable1 m) => Typeable1 (EventT t m) 
MonadFix m => MonadFix (EventT t m) 
MonadPlus m => MonadPlus (EventT t m) 
MonadIO m => MonadIO (EventT t m) 
MonadCont m => MonadCont (EventT t m) 
Monad m => MonadSimControl (EventT t m) 
Monad m => MonadTime (EventT t m) t 
(Monad m, Ord t) => MonadEventQueueInfo (EventT t m) t 
Monad m => RetryEvent (EventT t m) t 
Monad m => GetCurrentEvent (EventT t m) t 
(Monad m, Ord t) => CancelEvent (EventT t m) t 
(Monad m, Ord t, MonadEvent (EventT t m) e) => ScheduleEvent (EventT t m) t e 
(Monad m, Show t, Typeable t, Typeable1 m) => MonadEvent (EventT t m) (EventDescriptor (EventT t m) t) 
(Monad m, Typeable (EventT t m a)) => MonadEvent (EventT t m) (EventT t m a) 

data EventDescriptor m t Source

An existential wrapper containing an event which can be executed in the monad m.

I would like to existentially quantify the time parameter too, since it's uniquely determined according to the functional dependencies of MonadTime, but GHC doesn't unify it with its actual type in pattern matches - I was not able to use it as a PrintfArg in:

 instance MonadEvent (EventT Double IO) (EventDescriptor (EventT Double IO))


forall e . ScheduleEvent m t e => EventDescriptor 


eventId :: EventID
eventTime :: t
event :: e

newtype EventID Source

An opaque identifier for events.


EventID Int