timeless-0.8.0.0: Timeless is a Arrow based Functional Reactive Programming library

Copyright(c) 2015 Rongcui Dong
LicenseBSD3
MaintainerRongcui Dong <karl_1702@188.com>
Safe HaskellSafe
LanguageHaskell2010

FRP.Timeless.Prefab.Discrete

Description

 

Synopsis

Documentation

occursFor Source

Arguments

:: Monad m 
=> b

Constant Output

-> Int

Number of sample periods

-> Signal s m a b 

Produces output for a several sample periods, then inhibits.

Typical usage:

() `occursFor` 1 >>> <some IO actions> >>> snapOnce

The example above will perform the IO action once and then hold the result forever

snapOnce :: Monad m => Signal s m a a Source

Takes the snapshot of the value when signal is activated, and then holds value forever

Typical usage:

() `occursFor` 1 >>> <some IO actions> >>> snapOnce

The example above will perform the IO action once and then hold the result forever

inhibitsAfter :: Int -> Signal s m a a Source

Acts as identity for a several sample periods, then inhibits.

runAndHold :: Monad m => Signal s m a b -> Signal s m a b Source

Runs a signal once and hold the result forever.

It is a combination of inhibitsAfter and snapOnce

rising Source

Arguments

:: Monad m 
=> Bool

Initial value

-> Signal s m Bool Bool 

Rising edge filter. Creates an impulse at rising edge

falling Source

Arguments

:: Monad m 
=> Bool

Initial value

-> Signal s m Bool Bool 

Falling edge filter. Creates an impulse at falling edge

edge Source

Arguments

:: Monad m 
=> Bool

Initial value

-> Signal s m Bool Bool 

Edge filter. Creates an impulse at edge