| |||||||||||
| |||||||||||
| |||||||||||
Description | |||||||||||
This module is about segmented signals. For a general introduction to signals, see the documentation of FRP.Grapefruit.Signal. | |||||||||||
Synopsis | |||||||||||
| |||||||||||
Segmented signal type | |||||||||||
| |||||||||||
| |||||||||||
Introduction | |||||||||||
| |||||||||||
Constructs a segmented signal from an initial value and a series of updates. A signal fromInitAndUpdate init upd has initially the value init. At each occurence in upd, it has an update point and changes its value to the value occuring in upd. If the segmented signal is interpreted as a kind of discrete signal, fromInitAndUpdate just adds an initial occurence of init to the signal upd. | |||||||||||
Accessors | |||||||||||
| |||||||||||
Applies the second argument to the initial value of the first argument. Using withInit, it is possible to create a signal which is dependent on the initial value of a segmented signal but it is not possible to extract the initial value itself. The reason for this restriction is that the initial value may depend on values of continuous signals and therefore its calculation might involve doing I/O to read external continuous sources. | |||||||||||
| |||||||||||
Yields the sequence of updates of a segmented signal. If the segmented signal is interpreted as a discrete signal with an additional occurence at the start then update just drops this occurence. | |||||||||||
Stateful signals | |||||||||||
| |||||||||||
Accumulates the values of a discrete signal. Applying scan init fun to a discrete signal replaces its occurence values val_1, val_2 and so on by the values init `fun` val_1, (init `fun` val_1) `fun` val_2 and so on and adds an occurence of the value init at the beginning. | |||||||||||
Connectors | |||||||||||
| |||||||||||
Converts an event handler into a segmented signal consumer. If a segmented signal is consumed with such a consumer, the handler is called at the starting time of the era and at each update with the current value of the signal as its argument. If the segmented signal is seen as a discrete signal with an additional occurence at the start then consumer behaves analogous to the consumer function of FRP.Grapefruit.Signal.Discrete. | |||||||||||
Produced by Haddock version 2.4.2 |