Yampa-0.13.5: Elegant Functional Reactive Programming Language for Hybrid Systems
Copyright(c) Antony Courtney and Henrik Nilsson Yale University 2003
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainerivan.perez@keera.co.uk
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

FRP.Yampa.Scan

Description

Simple, stateful signal processing.

Scanning implements elementary, step-based accumulating over signal functions by means of an auxiliary function applied to each input and to an accumulator. For comparison with other FRP libraries and with stream processing abstractions, think of fold.

Synopsis

Documentation

sscan :: (b -> a -> b) -> b -> SF a b Source #

Applies a function point-wise, using the last output as next input. This creates a well-formed loop based on a pure, auxiliary function.

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

Generic version of sscan, in which the auxiliary function produces an internal accumulator and an "held" output.

Applies a function point-wise, using the last known Just output to form the output, and next input accumulator. If the output is Nothing, the last known accumulators are used. This creates a well-formed loop based on a pure, auxiliary function.