ForSyDe-3.1.1: ForSyDe's Haskell-embedded Domain Specific Language.

Portabilityportable
Stabilityexperimental
Maintainerforsyde-dev@ict.kth.se

ForSyDe.Shallow.UntimedLib

Contents

Description

The untimed library defines process constructors and processes for the untimed computational model. A process constructor is a higher order function which together with combinational function(s) and values as arguments constructs a process.

Synopsis

Combinational process constructors

Combinational process constructors are used for processes that do not have a state.

combU :: Int -> ([a] -> [b]) -> Signal a -> Signal bSource

comb2U :: Int -> Int -> ([a] -> [b] -> [c]) -> Signal a -> Signal b -> Signal cSource

comb2UC :: Int -> (a -> [b] -> [c]) -> Signal a -> Signal b -> Signal cSource

mapU :: Int -> ([a] -> [b]) -> Signal a -> Signal bSource

The first parameter of mapU is a constant integer defining the number of tokens consumed in every evaluation cycle. The second argument is a function on lists of the input type and returning a list of the output type. For instance,

 r2 = mapU 1 f
   where f :: [Int] -> [Int]
         f [x] = [2*x]

defines a process r2 which consumes one token in each evaluation cycle and multiplies it by two.

Sequential process constructors

Sequential process constructors are used for processes that have a state. One of the input parameters is the initial state.

scanU :: (b -> Int) -> (b -> [a] -> b) -> b -> Signal a -> Signal bSource

scanU has an internal state which is visible at the output. The first argument is a function 'gamma' which, given the state returns the number of tokens consumed next. The second argument is the next state function and the third is the initial state.

mealyU :: (b -> Int) -> (b -> [a] -> b) -> (b -> [a] -> [c]) -> b -> Signal a -> Signal cSource

The process constructor mealyU creates a state machine of Moore type. In addition to the next state function they also have an output encoding function. The output depends directly on the internal state.

mooreU :: (b -> Int) -> (b -> [a] -> b) -> (b -> [c]) -> b -> Signal a -> Signal cSource

The process constructor mooreU creates a state machine of Moore type. In addition to the next state function they also have an output encoding function. The output depends directly on the internal state.

sourceU :: (a -> a) -> a -> Signal aSource

sinkU :: (a -> Int) -> (a -> a) -> a -> Signal b -> Signal bSource

initU :: [a] -> Signal a -> Signal aSource

initU is used to initialise a signal. Its first argument is prepended to its second argument, a signal.

Zipping and unzipping signals

zipU :: Signal (Int, Int) -> Signal a -> Signal b -> Signal ([a], [b])Source

zipUs :: Int -> Int -> Signal a -> Signal b -> Signal ([a], [b])Source

zipWithU :: Int -> Int -> ([a] -> [b] -> [c]) -> Signal a -> Signal b -> Signal cSource

zipWith3U :: Int -> Int -> Int -> ([a] -> [b] -> [c] -> [d]) -> Signal a -> Signal b -> Signal c -> Signal dSource

zipWith4U :: Int -> Int -> Int -> Int -> ([a] -> [b] -> [c] -> [d] -> [e]) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal eSource

unzipU :: Signal ([a], [b]) -> (Signal a, Signal b)Source