aivika-branches-0.4: Nested discrete event simulation module for the Aivika library
CopyrightCopyright (c) 2016-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Branch.BR

Description

Tested with: GHC 7.10.3

This module defines that BR can be an instance of the MonadDES and EventIOQueueing type classes.

Synopsis

Documentation

data BR m a Source #

The branching computation.

Instances

Instances details
MonadTrans BR Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

lift :: Monad m => m a -> BR m a #

MonadComp (BR IO) Source # 
Instance details

Defined in Simulation.Aivika.Branch.BR

MonadDES (BR IO) Source # 
Instance details

Defined in Simulation.Aivika.Branch.BR

MonadException m => MonadException (BR m) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

catchComp :: Exception e => BR m a -> (e -> BR m a) -> BR m a #

finallyComp :: BR m a -> BR m b -> BR m a #

throwComp :: Exception e => e -> BR m a #

MonadGenerator (BR IO) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Generator

Associated Types

data Generator (BR IO) #

EventIOQueueing (BR IO) Source #

An implementation of the EventIOQueueing type class.

Instance details

Defined in Simulation.Aivika.Branch.BR

Methods

enqueueEventIO :: Double -> Event (BR IO) () -> Event (BR IO) () #

EventQueueing (BR IO) Source #

An implementation of the EventQueueing type class.

Instance details

Defined in Simulation.Aivika.Branch.Event

Associated Types

data EventQueue (BR IO) #

MonadRef (BR IO) Source #

The implementation of mutable references.

Instance details

Defined in Simulation.Aivika.Branch.Ref.Base.Lazy

Associated Types

data Ref (BR IO) a #

Methods

newRef :: a -> Simulation (BR IO) (Ref (BR IO) a) #

readRef :: Ref (BR IO) a -> Event (BR IO) a #

writeRef :: Ref (BR IO) a -> a -> Event (BR IO) () #

modifyRef :: Ref (BR IO) a -> (a -> a) -> Event (BR IO) () #

equalRef :: Ref (BR IO) a -> Ref (BR IO) a -> Bool #

MonadRef0 (BR IO) Source #

A subtype of mutable references that can be created under more weak conditions.

Instance details

Defined in Simulation.Aivika.Branch.Ref.Base.Lazy

Methods

newRef0 :: a -> BR IO (Ref (BR IO) a) #

MonadRef (BR IO) Source #

The implementation of mutable references.

Instance details

Defined in Simulation.Aivika.Branch.Ref.Base.Strict

Associated Types

data Ref (BR IO) a #

Methods

newRef :: a -> Simulation (BR IO) (Ref (BR IO) a) #

readRef :: Ref (BR IO) a -> Event (BR IO) a #

writeRef :: Ref (BR IO) a -> a -> Event (BR IO) () #

modifyRef :: Ref (BR IO) a -> (a -> a) -> Event (BR IO) () #

equalRef :: Ref (BR IO) a -> Ref (BR IO) a -> Bool #

MonadRef0 (BR IO) Source #

A subtype of mutable references that can be created under more weak conditions.

Instance details

Defined in Simulation.Aivika.Branch.Ref.Base.Strict

Methods

newRef0 :: a -> BR IO (Ref (BR IO) a) #

MonadFix m => MonadFix (BR m) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

mfix :: (a -> BR m a) -> BR m a #

MonadIO m => MonadIO (BR m) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

liftIO :: IO a -> BR m a #

Applicative m => Applicative (BR m) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

pure :: a -> BR m a #

(<*>) :: BR m (a -> b) -> BR m a -> BR m b #

liftA2 :: (a -> b -> c) -> BR m a -> BR m b -> BR m c #

(*>) :: BR m a -> BR m b -> BR m b #

(<*) :: BR m a -> BR m b -> BR m a #

Functor m => Functor (BR m) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

fmap :: (a -> b) -> BR m a -> BR m b #

(<$) :: a -> BR m b -> BR m a #

Monad m => Monad (BR m) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Internal.BR

Methods

(>>=) :: BR m a -> (a -> BR m b) -> BR m b #

(>>) :: BR m a -> BR m b -> BR m b #

return :: a -> BR m a #

DequeueStrategy (BR IO) FCFS Source #

An implementation of the FCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

DequeueStrategy (BR IO) LCFS Source #

An implementation of the LCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

EnqueueStrategy (BR IO) FCFS Source #

An implementation of the FCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

Methods

strategyEnqueue :: StrategyQueue (BR IO) FCFS a -> a -> Event (BR IO) () #

EnqueueStrategy (BR IO) LCFS Source #

An implementation of the LCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

Methods

strategyEnqueue :: StrategyQueue (BR IO) LCFS a -> a -> Event (BR IO) () #

QueueStrategy (BR IO) FCFS Source #

An implementation of the FCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

Associated Types

data StrategyQueue (BR IO) FCFS :: Type -> Type #

QueueStrategy (BR IO) LCFS Source #

An implementation of the LCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

Associated Types

data StrategyQueue (BR IO) LCFS :: Type -> Type #

data Generator (BR IO) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Generator

data EventQueue (BR IO) Source # 
Instance details

Defined in Simulation.Aivika.Branch.Event

newtype Ref (BR IO) a Source # 
Instance details

Defined in Simulation.Aivika.Branch.Ref.Base.Lazy

newtype Ref (BR IO) a = Ref {}
newtype Ref (BR IO) a Source # 
Instance details

Defined in Simulation.Aivika.Branch.Ref.Base.Strict

newtype Ref (BR IO) a = Ref {}
newtype StrategyQueue (BR IO) FCFS a Source # 
Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

newtype StrategyQueue (BR IO) LCFS a Source # 
Instance details

Defined in Simulation.Aivika.Branch.QueueStrategy

runBR :: MonadIO m => BR m a -> m a Source #

Run the branching computation.

branchLevel :: Monad m => BR m Int Source #

Return the current branch level starting from 0.

Orphan instances

MonadComp (BR IO) Source # 
Instance details

MonadDES (BR IO) Source # 
Instance details

EventIOQueueing (BR IO) Source #

An implementation of the EventIOQueueing type class.

Instance details

Methods

enqueueEventIO :: Double -> Event (BR IO) () -> Event (BR IO) () #