forsyde-shallow-3.4.0.0: ForSyDe's Haskell-embedded Domain Specific Language.

Copyright(c) ForSyDe Group KTH 2007-2008
LicenseBSD-style (see the file LICENSE)
Maintainerforsyde-dev@ict.kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

ForSyDe.Shallow.MoC.Untimed

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 b Source #

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

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

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

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 b Source #

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 c Source #

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 c Source #

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 a Source #

sinkU :: (a -> Int) -> (a -> a) -> a -> Signal b -> Signal b Source #

initU :: [a] -> Signal a -> Signal a Source #

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 c Source #

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

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

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