timeless-0.9.0.1: An Arrow based Functional Reactive Programming library

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

FRP.Timeless.Prefab.Primitive

Contents

Description

 

Synopsis

Basic Signals

mkEmpty :: Signal s m a b Source #

Make a signal that inhibits forever

mkId :: Signal s m a a Source #

The Identity Signal

mkConst :: Maybe b -> Signal s m a b Source #

Make a constant Signal

mkPure :: Monoid s => (s -> a -> (Maybe b, Signal s m a b)) -> Signal s m a b Source #

Make a pure stateful signal from given transition function

mkGen :: (Monad m, Monoid s) => (s -> a -> m (Maybe b, Signal s m a b)) -> Signal s m a b Source #

Make a stateful signal from given (Monadic) transition function

Pure Signals

Signals

mkPureN :: (a -> (Maybe b, Signal s m a b)) -> Signal s m a b Source #

Make a pure stateful signal from given time independant transition function

mkPure_ :: (a -> Maybe b) -> Signal s m a b Source #

Make a pure stateless signal from given function

mkSF :: Monoid s => (s -> a -> (b, Signal s m a b)) -> Signal s m a b Source #

Make a pure stateful signal from given signal function

mkSFN :: (a -> (b, Signal s m a b)) -> Signal s m a b Source #

Make a pure stateful signal from given time independant signal function

mkSF_ :: (a -> b) -> Signal s m a b Source #

Make a pure stateless signal from given signal function

mkSW_ :: b -> (b -> a -> b) -> Signal s m a b Source #

Make a stateful wire from chained state transition function. Notice that the output will always be the new value

Monadic Signals

mkGenN :: Monad m => (a -> m (Maybe b, Signal s m a b)) -> Signal s m a b Source #

Make a stateful signal from given (Monadic) time independant transition function

mkGen_ :: Monad m => (a -> m (Maybe b)) -> Signal s m a b Source #

Make a stateless signal from given function

Kleisli Signals

mkKleisli_ :: Monad m => (a -> m b) -> Signal s m a b Source #

Make a stateless signal from Kleisli function

mkSK_ :: Monad m => b -> (b -> a -> m b) -> Signal s m a b Source #

Make a stateful signal from Kleisli function

mkConstM :: Monad m => m b -> Signal s m a b Source #

Make a monadic constant wire

mkActM :: Monad m => m b -> Signal s m a b Source #

Make a monadic action wire, alias for mkConstM

Special signals

delay :: a -> Signal s m a a Source #

(From netwire) This wire delays its input signal by the smallest possible (semantically infinitesimal) amount of time. You can use it when you want to use feedback (ArrowLoop): If the user of the feedback depends on now, delay the value before feeding it back. The argument value is the replacement signal at the beginning.

  • Depends: before now.