netwire-1.0.0: Arrowized FRP implementation

MaintainerErtugrul Soeylemez <es@ertes.de>

FRP.NetWire.Session

Contents

Description

Wire sessions.

Synopsis

Sessions

data Session a b Source

Reactive sessions with the given time type.

Constructors

Session 

Fields

sessFreeVar :: TVar Bool

False, if in use.

sessStateRef :: IORef WireState

State of the last instant.

sessTimeRef :: IORef UTCTime

Time of the last instant.

sessWireRef :: IORef (Wire a b)

Wire for the next instant.

stepWire :: a -> Session a b -> IO (Maybe b)Source

Feed the given input value into the reactive system performing the next instant using real time.

stepWireDelta :: NominalDiffTime -> a -> Session a b -> IO (Maybe b)Source

Feed the given input value into the reactive system performing the next instant using the given time delta.

stepWireTime :: UTCTime -> a -> Session a b -> IO (Maybe b)Source

Feed the given input value into the reactive system performing the next instant, which is at the given time. This function is thread-safe.

stepWireTime' :: UTCTime -> a -> Session a b -> IO (Maybe b)Source

Feed the given input value into the reactive system performing the next instant, which is at the given time. This function is *not* thread-safe.

withWire :: Wire a b -> (Session a b -> IO c) -> IO cSource

Initialize a reactive session and pass it to the given continuation.