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

Control.Monad.Event

Synopsis

Documentation

scheduleEventAt :: (ScheduleEvent m t e, Num t) => t -> e -> m EventIDSource

schedule an event at an absolute time (see scheduleEventIn)

retryEventAt :: (RetryEvent m t, Num t) => t -> m EventIDSource

retry the currently-executing event at an absolute time (see retryEventIn)

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))

Constructors

forall e . ScheduleEvent m t e => EventDescriptor 

Fields

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

Instances

(Monad m, Pretty t) => MonadEvent (EventT t m) (EventDescriptor (EventT t m) t) 

newtype EventID Source

An opaque identifier for events.

Constructors

EventID Int