netwire-1.1.0: Arrowized FRP implementation

MaintainerErtugrul Soeylemez <es@ertes.de>

FRP.NetWire

Contents

Description

Arrowized FRP implementation for networking applications. The aim of this library is to provide a convenient FRP implementation, which should enable you to write entirely pure network sessions.

Synopsis

Wires

data Wire Source

A wire is a network of signal transformers.

Instances

Monad m => Arrow (Wire m) 
Monad m => ArrowZero (Wire m) 
Monad m => ArrowPlus (Wire m) 
Monad m => ArrowChoice (Wire m) 
Monad m => Category (Wire m) 
Monad m => Functor (Wire m a) 
Monad m => Applicative (Wire m a) 
Monad m => Alternative (Wire m a) 

type Event = MaybeSource

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

type Output = Either SomeExceptionSource

The output of a wire. When the wire inhibits, then this will be a Left value with an exception.

type Time = DoubleSource

Time.

Reactive sessions

data Session a b Source

Reactive sessions with the given time type.

stepWire :: a -> Session a b -> IO (Output 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 (Output 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 (Output 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.

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

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

Pure wires

type SF = Wire IdentitySource

Signal functions are wires over the identity monad.

stepSF :: Time -> a -> SF a b -> (Output b, SF a b)Source

Perform the next instant of a pure wire over the identity monad.

stepWirePure :: Monad m => Time -> a -> Wire m a b -> m (Output b, Wire m a b)Source

Perform the next instant of a pure wire.

Netwire Reexports

Other convenience reexports