chp-1.5.1: An implementation of concurrency ideas from Communicating Sequential ProcessesSource codeContentsIndex
Control.Concurrent.CHP.Traces.Structural
Description
This module contains support for structural traces. Structural traces reflect the parallel composition of your program. Effectively, each process records its own local trace. Parallel traces are then merged as parallel compositions, and you end up with a big tree of sequentially and parallel-composed traces. Note that in this tracing style, unlike CSP and VCR, events are recorded by every process involved in them, not just once per occurrence.
Synopsis
newtype StructuralTrace u = StructuralTrace (ChannelLabels u, Maybe (EventHierarchy (RecordedIndivEvent u)))
data EventHierarchy a
= SingleEvent a
| StructuralSequence Int [EventHierarchy a]
| StructuralParallel [EventHierarchy a]
getStructuralPlain :: StructuralTrace String -> Maybe (EventHierarchy (RecordedIndivEvent String))
runCHP_StructuralTrace :: CHP a -> IO (Maybe a, StructuralTrace Unique)
runCHP_StructuralTraceAndPrint :: CHP a -> IO ()
getAllEventsInHierarchy :: EventHierarchy a -> [a]
Documentation
newtype StructuralTrace u Source
A nested (or hierarchical) trace. The trace is an event hierarchy, wrapped in a Maybe type to allow for representation of the empty trace (Nothing).
Constructors
StructuralTrace (ChannelLabels u, Maybe (EventHierarchy (RecordedIndivEvent u)))
show/hide Instances
data EventHierarchy a Source

A data type representing a hierarchy of events. The count on the StructuralSequence count is a replicator count for that list of sequential items.

The Show, Read, Foldable and Traversable instances were added in version 1.3.0.

The Eq instance was added in version 1.5.0.

Constructors
SingleEvent a
StructuralSequence Int [EventHierarchy a]
StructuralParallel [EventHierarchy a]
show/hide Instances
getStructuralPlain :: StructuralTrace String -> Maybe (EventHierarchy (RecordedIndivEvent String))Source

A helper function for pulling out the interesting bit from a Structural trace processed by labelAll.

Added in version 1.5.0.

runCHP_StructuralTrace :: CHP a -> IO (Maybe a, StructuralTrace Unique)Source
runCHP_StructuralTraceAndPrint :: CHP a -> IO ()Source
getAllEventsInHierarchy :: EventHierarchy a -> [a]Source
Flattens the events into a list. The resulting list may contain duplicates, and it should not be assumed that the order relates in any way to the original hierarchy.
Produced by Haddock version 2.4.2