Copyright | (c) ForSyDe Group KTH 2007-2008 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | forsyde-dev@ict.kth.se |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
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
- combU :: Int -> ([a] -> [b]) -> Signal a -> Signal b
- comb2U :: Int -> Int -> ([a] -> [b] -> [c]) -> Signal a -> Signal b -> Signal c
- comb2UC :: Int -> (a -> [b] -> [c]) -> Signal a -> Signal b -> Signal c
- mapU :: Int -> ([a] -> [b]) -> Signal a -> Signal b
- scanU :: (b -> Int) -> (b -> [a] -> b) -> b -> Signal a -> Signal b
- mealyU :: (b -> Int) -> (b -> [a] -> b) -> (b -> [a] -> [c]) -> b -> Signal a -> Signal c
- mooreU :: (b -> Int) -> (b -> [a] -> b) -> (b -> [c]) -> b -> Signal a -> Signal c
- sourceU :: (a -> a) -> a -> Signal a
- sinkU :: (a -> Int) -> (a -> a) -> a -> Signal b -> Signal b
- initU :: [a] -> Signal a -> Signal a
- zipU :: Signal (Int, Int) -> Signal a -> Signal b -> Signal ([a], [b])
- zipUs :: Int -> Int -> Signal a -> Signal b -> Signal ([a], [b])
- zipWithU :: Int -> Int -> ([a] -> [b] -> [c]) -> Signal a -> Signal b -> Signal c
- zipWith3U :: Int -> Int -> Int -> ([a] -> [b] -> [c] -> [d]) -> Signal a -> Signal b -> Signal c -> Signal d
- zipWith4U :: Int -> Int -> Int -> Int -> ([a] -> [b] -> [c] -> [d] -> [e]) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e
- unzipU :: Signal ([a], [b]) -> (Signal a, Signal b)
Combinational process constructors
Combinational process constructors are used for processes that do not have a state.
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.
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
zipWith3U :: Int -> Int -> Int -> ([a] -> [b] -> [c] -> [d]) -> Signal a -> Signal b -> Signal c -> Signal d Source #