hasim-0.1.2: Process-Based Discrete Event Simulation library

Portabilityunportable
Stabilityexperimental
Maintainerjochem@functor.nl

Control.Hasim.WatchMap

Contents

Description

This module defines a WatchMap, a data structure that keeps track of which processes watch which other processes.

Synopsis

Abstract data type

data WatchMap Source

A watch map. This data structure represents a relation on processes.

Creation and inspection

watchersSource

Arguments

:: WatchMap

The WatchMap to be queried

-> Process
p2
-> [Process]

The list of p1's

Find all p1 such that (p1, p2) is in the relation.

Modification

registerSource

Arguments

:: Process
p1
-> Process
p2
-> WatchMap

old WatchMap

-> WatchMap

new WatchMap

Add the tuple (p1, p2) to the relation.

unregisterSource

Arguments

:: Process
p1
-> Process
p2
-> WatchMap

old WatchMap

-> WatchMap

new WatchMap

Remove the tuple (p1, p2) from the relation, if it existed.