netwire-1.0.0: Arrowized FRP implementation

MaintainerErtugrul Soeylemez <es@ertes.de>

FRP.NetWire.Wire

Contents

Description

The module contains the main Wire type.

Synopsis

Wires

data Wire a b whereSource

A wire is a network of signal transformers.

Constructors

WArr :: (a -> b) -> Wire a b 
WConst :: b -> Wire a b 
WGen :: (WireState -> a -> IO (Maybe b, Wire a b)) -> Wire a b 
WId :: Wire a a 

data WireState Source

The state of the wire.

Constructors

WireState 

Fields

wsDTime :: Double

Time difference for current instant.

wsRndGen :: MTGen

Random number generator.

wsReqVar :: TVar Int

Request counter.

Auxilliary types

type DTime = DoubleSource

Derivative of time. In English: It's the time between two instants of an FRP session.

type Event = MaybeSource

Events are signals, which can be absent. They usually denote discrete occurences of certain events.

type Time = DoubleSource

Time.

Utilities

cleanupWireState :: WireState -> IO ()Source

Clean up wire state.

initWireState :: IO WireStateSource

Initialize wire state.

mkGen :: (WireState -> a -> IO (Maybe b, Wire a b)) -> Wire a bSource

Create a generic wire from the given function. This is a smart constructor. Please use it instead of the WGen constructor.

toGen :: Wire a b -> WireState -> a -> IO (Maybe b, Wire a b)Source

Extract the transition function of a wire.