In a pipe, each data item appearing onto the input stream is transformed into a data output of the output stream by applying a sequence of functions f1 ... fn over it.

Functionally pipe f has type

'a0 stream -> 'an stream
provided that the functions fi have type

'a0 -> 'a1

'a1 -> 'a2

...

'a(n-1) -> 'an

Given the input stream :xn:...:x1:x0: the n-stage pipe f1 ||| f2 ||| ... ||| fn computes the output stream :fn(...(f2(f1 xn))...):...:fn(...(f2(f1 x1))...):fn(...(f2(f1 x0))...)

In terms of (parallel) processes, a sequence of data appearing onto the input stream of a pipe is submitted to the first pipeline stage. The output of this stage is submitted to the second stage and so on and so on until the output of the (n-1) stage is submitted to the last stage. Eventually, the last stage delivers its own output onto the pipeline output channel. The resulting process network looks like the following:

Have a look at the pipe behaviour, in terms of data items processed.


Back to the skeleton set page.