Yampa-0.10.5.1: Library for programming hybrid systems.

Copyright (c) Antony Courtney and Henrik Nilsson Yale University 2003 BSD-style (see the LICENSE file in the distribution) ivan.perez@keera.co.uk provisional non-portable (GHC extensions) None Haskell98

FRP.Yampa.Hybrid

Description

Synopsis

# Discrete to continuous-time signal functions

## Wave-form generation

hold :: a -> SF (Event a) a Source #

Zero-order hold.

dHold :: a -> SF (Event a) a Source #

Zero-order hold with delay.

Identity: dHold a0 = hold a0 >>> iPre a0).

trackAndHold :: a -> SF (Maybe a) a Source #

Tracks input signal when available, holds last value when disappears.

!!! DANGER!!! Event used inside arr! Probably OK because arr will not be !!! optimized to arrE. But still. Maybe rewrite this using, say, scan? !!! or switch? Switching (in hold) for every input sample does not !!! seem like such a great idea anyway.

dTrackAndHold :: a -> SF (Maybe a) a Source #

## Accumulators

accum :: a -> SF (Event (a -> a)) (Event a) Source #

Given an initial value in an accumulator, it returns a signal function that processes an event carrying transformation functions. Every time an Event is received, the function inside it is applied to the accumulator, whose new value is outputted in an Event.

accumHold :: a -> SF (Event (a -> a)) a Source #

Zero-order hold accumulator (always produces the last outputted value until an event arrives).

dAccumHold :: a -> SF (Event (a -> a)) a Source #

Zero-order hold accumulator with delayed initialization (always produces the last outputted value until an event arrives, but the very initial output is always the given accumulator).

accumBy :: (b -> a -> b) -> b -> SF (Event a) (Event b) Source #

Accumulator parameterized by the accumulation function.

accumHoldBy :: (b -> a -> b) -> b -> SF (Event a) b Source #

Zero-order hold accumulator parameterized by the accumulation function.

dAccumHoldBy :: (b -> a -> b) -> b -> SF (Event a) b Source #

Zero-order hold accumulator parameterized by the accumulation function with delayed initialization (initial output sample is always the given accumulator).

accumFilter :: (c -> a -> (c, Maybe b)) -> c -> SF (Event a) (Event b) Source #

Accumulator parameterized by the accumulator function with filtering, possibly discarding some of the input events based on whether the second component of the result of applying the accumulation function is Nothing or Just x for some x.