par package:Yampa

Spatial parallel composition of a signal function collection parameterized on the routing function.
Spatial parallel composition of a signal function collection. Given a collection of signal functions, it returns a signal function that broadcasts its input signal to every element of the collection, to return a signal carrying a collection of outputs. See par. For more information on how parallel composition works, check https://www.antonycourtney.com/pubs/hw03.pdf
Apply an SF to every element of a list. Example:
>>> embed (parC integral) (deltaEncode 0.1 [[1, 2], [2, 4], [3, 6], [4.0, 8.0 :: Float]])
[[0.0,0.0],[0.1,0.2],[0.3,0.6],[0.6,1.2]]
The number of SFs or expected inputs is determined by the first input list, and not expected to vary over time. If more inputs come in a subsequent list, they are ignored.
>>> embed (parC (arr (+1))) (deltaEncode 0.1 [[0], [1, 1], [3, 4], [6, 7, 8], [1, 1], [0, 0], [1, 9, 8]])
[[1],[2],[4],[7],[2],[1],[2]]
If less inputs come in a subsequent list, an exception is thrown.
>>> embed (parC (arr (+1))) (deltaEncode 0.1 [[0, 0], [1, 1], [3, 4], [6, 7, 8], [1, 1], [0, 0], [1, 9, 8]])
[[1,1],[2,2],[4,5],[7,8],[2,2],[1,1],[2,10]]
Parallel composition of a list of SFs. Given a list of SFs, returns an SF that takes a list of inputs, applies each SF to each input in order, and returns the SFs' outputs.
>>> embed (parZ [arr (+1), arr (+2)]) (deltaEncode 0.1 [[0, 0], [1, 1]])
[[1,2],[2,3]]
If there are more SFs than inputs, an exception is thrown.
>>> embed (parZ [arr (+1), arr (+1), arr (+2)]) (deltaEncode 0.1 [[0, 0], [1, 1]])
[[1,1,*** Exception: FRP.Yampa.Switches.parZ: Input list too short.
If there are more inputs than SFs, the unused inputs are ignored.
>>> embed (parZ [arr (+1)]) (deltaEncode 0.1 [[0, 0], [1, 1]])
[[1],[2]]