rhine-1.0: Functional Reactive Programming with type-level clocks
Safe HaskellSafe-Inferred
LanguageHaskell2010

FRP.Rhine.ResamplingBuffer.Timeless

Description

Resampling buffers from asynchronous Mealy machines. These are used in many other modules implementing ResamplingBuffers.

Synopsis

Documentation

data AsyncMealy m s a b Source #

An asynchronous, effectful Mealy machine description. (Input and output do not happen simultaneously.) It can be used to create ResamplingBuffers.

Constructors

AsyncMealy 

Fields

  • amPut :: s -> a -> m s

    Given the previous state and an input value, return the new state.

  • amGet :: s -> m (b, s)

    Given the previous state, return an output value and a new state.

timelessResamplingBuffer Source #

Arguments

:: Monad m 
=> AsyncMealy m s a b 
-> s

The initial state

-> ResamplingBuffer m cl1 cl2 a b 

A resampling buffer that is unaware of the time information of the clock, and thus clock-polymorphic. It is built from an asynchronous Mealy machine description. Whenever get is called on timelessResamplingBuffer machine s, the method amGet is called on machine with state s, discarding the time stamp. Analogously for put.

trivialResamplingBuffer :: Monad m => ResamplingBuffer m cl1 cl2 () () Source #

A resampling buffer that only accepts and emits units.