event-monad-0.0.1.0: Event-graph simulation monad transformerSource codeContentsIndex
Control.Monad.Event
Synopsis
data EventT t m a
type EventM = EventIO Double
module Control.Monad.Event.BasicEvents
module Control.Monad.Event.Classes
data EventDescriptor m t = forall e . ScheduleEvent m t e => EventDescriptor {
eventId :: EventID
eventTime :: t
event :: e
}
newtype EventID = EventID Int
Documentation
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.

show/hide Instances
type EventM = EventIO DoubleSource
module Control.Monad.Event.BasicEvents
module Control.Monad.Event.Classes
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
eventId :: EventID
eventTime :: t
event :: e
show/hide Instances
newtype EventID Source
An opaque identifier for events.
Constructors
EventID Int
show/hide Instances
Produced by Haddock version 2.4.2