|
ForSyDe.Shallow.Signal | Portability | portable | Stability | experimental | Maintainer | forsyde-dev@ict.kth.se |
|
|
|
Description |
This module defines the shallow-embedded Signal datatype and
functions operating on it.
|
|
Synopsis |
|
|
|
Documentation |
|
|
A signal is defined as a list of events. An event has a tag and a value. The tag of an event is defined by the position in the list. A signal is defined as an instance of the classes Read and Show. The signal 1 :- 2 :- NullS is represented as {1,2}.
| Constructors | | Instances | |
|
|
|
The operator '-:' adds at an element to a signal at the tail.
|
|
|
The operator +-+ concatinates two signals into one signal.
|
|
|
|
|
The function signal converts a list into a signal.
|
|
|
The function fromSignal converts a signal into a list.
|
|
|
The function unitS creates a signal with one value.
|
|
|
The function nullS checks if a signal is empty.
|
|
|
The function headS gives the first value - the head - of a signal.
|
|
|
The function tailS gives the rest of the signal - the tail.
|
|
|
The function atS returns the n-th event in a signal. The numbering of events in a signal starts with 0. There is also an operator version of this function, '(!-)'.
|
|
|
The function takeS returns the first n values of a signal.
|
|
|
The function dropS drops the first $n$ values from a signal.
|
|
|
The function lengthS returns the length of a finite signal.
|
|
|
The function infiniteS creates an infinite signal. The first argument f is a function that is applied on the current value. The second argument x gives the first value of the signal.
Signal> takeS 5 (infiniteS (*3) 1)
{1,3,9,27,81} :: Signal Integer
|
|
|
The function copyS creates a signal with n values x.
|
|
|
The function selectS takes three parameters, an offset, a stepsize and a signal and returns some elements of the signal such as in the following example:
Signal> selectS 2 3 (signal[1,2,3,4,5,6,7,8,9,10])
{3,6,9} :: Signal Integer
|
|
|
The function writeS transforms a signal into a string of the following format:
Signal> writeS (signal[1,2,3,4,5])
1n2n3n4n5n :: [Char]
|
|
|
The function readS transforms a formatted string into a signal.
Signal> readS 1n2n3n4n5n :: Signal Int
{1,2,3,4,5} :: Signal Int
|
|
|
The combinator fanS takes two processes p1 and p2 and and generates a process network, where a signal is split and processed by the processes p1 and p2.
|
|
Produced by Haddock version 2.1.0 |