Copyright | (c) 2015 Rongcui Dong |
---|---|
License | BSD3 |
Maintainer | Rongcui Dong <karl_1702@188.com> |
Safe Haskell | Safe |
Language | Haskell2010 |
- occursFor :: Monad m => b -> Int -> Signal s m a b
- impulse :: Monad m => b -> Signal s m a b
- oneShot :: Monad m => b -> Signal s m a b
- snapOnce :: Monad m => Signal s m a a
- inhibitsAfterPeriods :: Int -> Signal s m a a
- runAndHold :: Monad m => Signal s m a b -> Signal s m a b
- rising :: Monad m => Bool -> Signal s m Bool Bool
- falling :: Monad m => Bool -> Signal s m Bool Bool
- edge :: Monad m => Bool -> Signal s m Bool Bool
- latch :: Monad m => Bool -> Signal s m (Bool, Bool) Bool
- latchS :: Monad m => Signal s m Bool Bool
- latchR :: Monad m => Signal s m Bool Bool
Discrete Signals
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
impulse :: Monad m => b -> Signal s m a b Source #
A value that appears for a semantically infinitely short period of time
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
inhibitsAfterPeriods :: 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
Logic Signals
Rising edge filter. Creates an impulse at rising edge
Falling edge filter. Creates an impulse at falling edge
Edge filter. Creates an impulse at edge
A Set-Reset latch, with the first input set, second input reset. Current output value has higher priority (Prefer lazy!)