This module provides records of signals and signal-related data.
A record has a type of the following form:
A value of such a type is a list of fields where the ith field has type
Of` val_i) style
(:::) is a data family. Its
style parameter is a phantom type which selects the instance
of the family. For a concrete
style type, the type
(name ::: signal ` covers name-value pairs where the type of the values depends on
val. For example, if
style is of the form
, the values have type
signal era val. This leads to records of signals with identical era. With the styles
, it is possible to form records of
consumers and producers.
Field names are represented by types which are declared as follows:
data Name = Name
This makes it possible to use names as types (allowing the use of names in compile-time checks) but also as expressions and patterns.
- data SignalKind
- type SignalRecord era record = record (SignalStyle era)
- data SignalStyle era
- type ConsumerRecord record = ConnectorRecord Consumer record
- type ProducerRecord record = ConnectorRecord Producer record
- type ConnectorRecord connector record = record (ConnectorStyle connector)
- data ConnectorStyle connector
- consume :: Record SignalKind record => ConsumerRecord record -> Circuit era (SignalRecord era record) ()
- produce :: Record SignalKind record => ProducerRecord record -> Circuit era () (SignalRecord era record)
Records which contain signals of a common era as values.
The style of signal records of a specific era.
Fields of signal style records have the form
name ::= signal.
Records which contain signal consumers as values.
Records which contain signal producers as values.
Records which which contain signal connectors (producers or consumers) as values.
The consumer and producer record styles.
Converts a record of consumers into a circuit that consumes a corresponding record of signals.