Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|---|

Safe Haskell | None |

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
- accum1 :: (b -> a -> b) -> b -> Wire e m a b
- accumT1 :: (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 bSource

The most general accumulator. This wire corresponds to a left scan.

- Depends: previous instant.

accumT :: (Time -> b -> a -> b) -> b -> Wire e m a bSource

Like `accum`

, but the accumulation function also receives the
current time delta.

- Depends: previous instant.

accum1 :: (b -> a -> b) -> b -> Wire e m a bSource

Non-delaying variant of `accum`

.

- Depends: current instant.

accumT1 :: (Time -> b -> a -> b) -> b -> Wire e m a bSource

Non-delaying variant of `accumT`

.

- Depends: current instant.

## Function iteration

iterateW :: (b -> b) -> b -> Wire e m a bSource

Apply the input function continously. Corresponds to `iterate`

for
lists.

iterateWT :: (Time -> b -> b) -> b -> Wire e m a bSource

Like `iterate`

, but the accumulation function also receives the
current time delta.

## Generic unfolding

unfold :: (s -> a -> (b, s)) -> s -> Wire e m a bSource

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 bSource

Like `unfold`

, but the accumulation function also receives the
current time delta.

- Depends: current instant, if the given function is strict in its third argument.

# Special

countFrom :: AdditiveGroup b => b -> Wire e m b bSource

Counts from the given vector adding the current input for the next instant.

- Depends: previous instant.