grapefruit-frp- Functional Reactive Programming core

Safe HaskellNone




This module is about continuous signals.

For a general introduction to signals, see the documentation of FRP.Grapefruit.Signal.


Continuous signal type

data CSignal era val Source #

The type of continuous signals.

A continuous signal denotes a mapping from times to values. You can think of CSignal era val as being equivalent to Time era -> val where Time era is the type of all times of the given era.

Continuous signals are used to describe continuously changing values. They are also used for values changing at discrete times if there is no possibility of being notified about such changes. If there is a notification mechanism then segemented signals, provided by FRP.Grapefruit.Signal.Segmented, should be used.


Samplee CSignal Source # 


dSample :: DSignal era (val -> val') -> CSignal era val -> DSignal era val'

sSample :: SSignal era (val -> val') -> CSignal era val -> SSignal era val'

Signal CSignal Source # 


osfSwitch :: SSignal era (PolyOSF CSignal val) -> CSignal era val

ssfSwitch :: SSignal era (PolySSF CSignal val shape) -> CSignal era val -> SignalFun era shape

Functor (CSignal era) Source # 


fmap :: (a -> b) -> CSignal era a -> CSignal era b #

(<$) :: a -> CSignal era b -> CSignal era a #

Applicative (CSignal era) Source # 


pure :: a -> CSignal era a #

(<*>) :: CSignal era (a -> b) -> CSignal era a -> CSignal era b #

(*>) :: CSignal era a -> CSignal era b -> CSignal era b #

(<*) :: CSignal era a -> CSignal era b -> CSignal era a #


fromSSignal :: SSignal era val -> CSignal era val Source #

Converts a segmented signal into a continous signal, dropping the information about update points.


producer :: IO val -> Producer CSignal val Source #

Converts a value read action into a continuous signal producer.

The producer producer readVal produces a continuous signal whose current value is determined by executing readVal.