Copyright | (c) 2012 Ertugrul Soeylemez |
---|---|
License | BSD3 |
Maintainer | Ertugrul Soeylemez <es@ertes.de> |
Safe Haskell | None |
Language | Haskell2010 |
Accumulation wires. These are left-scan equivalents of several sorts.
- accum :: (b -> a -> b) -> b -> Wire e m a b
- accumT :: (Time -> b -> a -> b) -> b -> Wire e m a b
- iterateW :: (b -> b) -> b -> Wire e m a b
- iterateWT :: (Time -> b -> b) -> b -> Wire e m a b
- unfold :: (s -> a -> (b, s)) -> s -> Wire e m a b
- unfoldT :: (Time -> s -> a -> (b, s)) -> s -> Wire e m a b
- countFrom :: AdditiveGroup b => b -> Wire e m b b
- enumFromW :: Enum b => b -> Wire e m a b
- mconcatW :: Monoid b => Wire e m b b
General
Accumulation
accum :: (b -> a -> b) -> b -> Wire e m a b Source
The most general accumulator. This wire corresponds to a left scan.
- Depends: previous instant.
accumT :: (Time -> b -> a -> b) -> b -> Wire e m a b Source
Like accum
, but the accumulation function also receives the
current time delta.
- Depends: previous instant, time.
Function iteration
iterateW :: (b -> b) -> b -> Wire e m a b Source
Apply the input function continously. Corresponds to iterate
for
lists.
iterateWT :: (Time -> b -> b) -> b -> Wire e m a b Source
Like iterate
, but the accumulation function also receives the
current time delta.
- Depends: time.
Generic unfolding
unfold :: (s -> a -> (b, s)) -> s -> Wire e m a b Source
Corresponds to unfoldr
for lists.
- Depends: current instant, if the unfolding function is strict in its second argument.
unfoldT :: (Time -> s -> a -> (b, s)) -> s -> Wire e m a b Source
Like unfold
, but the accumulation function also receives the
current time delta.
- Depends: current instant, if the unfolding function is strict in its third argument, time.
Special
countFrom :: AdditiveGroup b => b -> Wire e m b b Source
Counts from the given vector adding the current input for the next instant.
- Depends: previous instant.