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

FRP.Rhine.ResamplingBuffer.Collect

Description

Resampling buffers that collect the incoming data in some data structure and release all of it on output.

Synopsis

Documentation

collect :: Monad m => ResamplingBuffer m cl1 cl2 a [a] Source #

Collects all input in a list, with the newest element at the head, which is returned and emptied upon get.

collectSequence :: Monad m => ResamplingBuffer m cl1 cl2 a (Seq a) Source #

Reimplementation of collect with sequences, which gives a performance benefit if the sequence needs to be reversed or searched.

pureBuffer :: Monad m => ([a] -> b) -> ResamplingBuffer m cl1 cl2 a b Source #

pureBuffer collects all input values lazily in a list and processes it when output is required. Semantically, pureBuffer f == collect >>-^ arr f, but pureBuffer is slightly more efficient.

foldBuffer Source #

Arguments

:: Monad m 
=> (a -> b -> b)

The folding function

-> b

The initial value

-> ResamplingBuffer m cl1 cl2 a b 

A buffer collecting all incoming values with a folding function. It is strict, i.e. the state value b is calculated on every put.