| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Description | |||||||||||||||||||||||||||||||||||||||
This module is about discrete signals. For a general introduction to signals, see the documentation of FRP.Grapefruit.Signal. | |||||||||||||||||||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Discrete signal type | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Empty signal | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
A signal with no occurrences. | |||||||||||||||||||||||||||||||||||||||
Combination | |||||||||||||||||||||||||||||||||||||||
Union | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs the left-biased union of two discrete signals. union is equivalent to unionWith const. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs the union of two discrete signals, combining simultaneously occuring values via a combining function. unionWith is equivalent to transUnion id id. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Union with conversion and combination. At each time, a signal dSignal1 or a signal dSignal2 has an occurence, the signal transUnion conv1 conv2 comb dSignal1 dSignal2 has an occurence, too. The value of this occurence is formed as follows:
| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Repeated left-biased union. unions is equivalent to foldl union empty and unionsWith const. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Repeated union with a combining function. unionsWith comb is equivalent to foldl (unionWith comb) empty. | |||||||||||||||||||||||||||||||||||||||
Difference | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs the difference of two discrete signals. difference is equivalent to differenceWith (\_ _ -> Nothing). | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs a kind of difference of two discrete signals where occurences may be modified instead of being dropped. At each time, a signal dSignal1 has an occurence of a value val1, the signal differenceWith comb dSignal1 dSignal has
| |||||||||||||||||||||||||||||||||||||||
Intersection | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs the left-biased intersection of two discrete signals. intersection is equivalent to intersectionWith const. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs the intersection of two discrete signals, combining values via a combining function. | |||||||||||||||||||||||||||||||||||||||
Mapping and filtering | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Converts each value occuring in a discrete signal by applying a function to it. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Drops all occurence of a discrete signal whose values do not fulfill a given predicate. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Converts all occurences with values of the form Just val into occurences with value val and drops all occurences with value Nothing. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Stateful signals | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Accumulates the values of a discrete signal, starting with a given initial value. 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. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Accumulates the values of a discrete signal, starting with the first occuring value. Applying scan1 init fun to a discrete signal replaces its occurence values val_1, val_2, val_3 and so on by the values val_1, val_1 `fun` val_2, (val_1 `fun` val_2) `fun` val_3 and so on. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Constructs a discrete signal by repeatedly applying state transformers. Applying stateful init to a discrete signal replaces its occurence values trans_1, trans_2, trans_3 and so on by the values fst . trans_1 $ init, fst . trans_2 $ snd . trans_1 $ init, fst . trans_3 $ snd . trans_2 $ snd . trans_1 $ init and so on. | |||||||||||||||||||||||||||||||||||||||
Connectors | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Converts an event handler into a discrete signal consumer. If a discrete signal is consumed with such a consumer, the handler is called at each occurence with the occuring value as its argument. | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Converts an event handler registration into a discrete signal producer. Applying the argument of producer to an event handler has to yield a setup which makes the handler be called with a certain value everytime the produced signal shall have an occurence of this value. | |||||||||||||||||||||||||||||||||||||||
Produced by Haddock version 2.4.2 |