Copyright | Copyright (c) 2009-2016 David Sorokin <david.sorokin@gmail.com> |
---|---|

License | BSD3 |

Maintainer | David Sorokin <david.sorokin@gmail.com> |

Stability | experimental |

Safe Haskell | None |

Language | Haskell2010 |

Tested with: GHC 8.0.1

The module defines a gate which can be either opened or closed.

- data Gate m
- newGate :: MonadDES m => Bool -> Simulation m (Gate m)
- newGateOpened :: MonadDES m => Simulation m (Gate m)
- newGateClosed :: MonadDES m => Simulation m (Gate m)
- openGate :: MonadDES m => Gate m -> Event m ()
- closeGate :: MonadDES m => Gate m -> Event m ()
- gateOpened :: MonadDES m => Gate m -> Event m Bool
- gateClosed :: MonadDES m => Gate m -> Event m Bool
- awaitGateOpened :: MonadDES m => Gate m -> Process m ()
- awaitGateClosed :: MonadDES m => Gate m -> Process m ()
- gateChanged_ :: MonadDES m => Gate m -> Signal m ()

# Documentation

newGate :: MonadDES m => Bool -> Simulation m (Gate m) Source #

Create a new gate, specifying whether the gate is initially open.

newGateOpened :: MonadDES m => Simulation m (Gate m) Source #

Create a new initially open gate.

newGateClosed :: MonadDES m => Simulation m (Gate m) Source #

Create a new initially close gate.

awaitGateOpened :: MonadDES m => Gate m -> Process m () Source #

Await the gate to be opened if required. If the gate is already open then the computation returns immediately.