Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|
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.
- data Wire
- type Output = Either SomeException
- type Time = Double
- data Session m a b
- stepWire :: MonadControlIO m => a -> Session m a b -> m (Output b)
- stepWireDelta :: MonadControlIO m => NominalDiffTime -> a -> Session m a b -> m (Output b)
- stepWireTime :: MonadControlIO m => UTCTime -> a -> Session m a b -> m (Output b)
- withWire :: MonadControlIO m => Wire m a b -> (Session m a b -> m c) -> m c
- type SF = Wire Identity
- stepSF :: Time -> a -> SF a b -> (Output b, SF a b)
- stepWirePure :: Monad m => Time -> a -> Wire m a b -> m (Output b, Wire m a b)
- data InhibitException = InhibitException String
- inhibitEx :: String -> SomeException
- noEvent :: SomeException
- module FRP.NetWire.Analyze
- module FRP.NetWire.Calculus
- module FRP.NetWire.Concurrent
- module FRP.NetWire.Event
- module FRP.NetWire.IO
- module FRP.NetWire.Random
- module FRP.NetWire.Request
- module FRP.NetWire.Switch
- module FRP.NetWire.Tools
- module Control.Monad.IO.Class
- module Control.Monad.IO.Control
- module Data.Functor.Identity
Wires
A wire is a network of signal transformers.
Monad m => Arrow (Wire m) | Arrow interface to signal networks. |
Monad m => ArrowZero (Wire m) | The zero arrow always inhibits. |
Monad m => ArrowPlus (Wire m) | Left-biased signal network combination. If the left arrow inhibits, the right arrow is tried. If both inhibit, their combination inhibits. |
Monad m => ArrowChoice (Wire m) | Signal routing. Unused routes are frozen, until they are put back into use. |
MonadFix m => ArrowLoop (Wire m) | Value recursion. Warning: Recursive signal networks must never
inhibit. Use |
Monad m => Category (Wire m) | Identity signal network and signal network sequencing. |
Monad m => Functor (Wire m a) | Map over the result of a signal network. |
Monad m => Applicative (Wire m a) | Applicative interface to signal networks. |
Monad m => Alternative (Wire m a) | This instance corresponds to the |
type Output = Either SomeExceptionSource
Functor for output signals.
Reactive sessions
Reactive sessions with the given input and output types over the
given monad. The monad must have a MonadControlIO
instance to be
usable with the stepping functions.
:: MonadControlIO m | |
=> a | Input value. |
-> Session m a b | Session to step. |
-> m (Output b) | System's output. |
Feed the given input value into the reactive system performing the next instant using real time.
:: MonadControlIO m | |
=> NominalDiffTime | Time delta. |
-> a | Input value. |
-> Session m a b | Session to step. |
-> m (Output b) | System's output. |
Feed the given input value into the reactive system performing the next instant using the given time delta.
:: MonadControlIO m | |
=> UTCTime | Absolute time of the instant to perform. |
-> a | Input value. |
-> Session m a b | Session to step. |
-> m (Output b) | System's output. |
Feed the given input value into the reactive system performing the next instant, which is at the given time. This function is thread-safe.
:: MonadControlIO m | |
=> Wire m a b | Initial wire of the session. |
-> (Session m a b -> m c) | Continuation, which receives the session data. |
-> m c | Continuation's result. |
Initialize a reactive session and pass it to the given continuation.
Pure wires
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.
Inhibition
data InhibitException Source
Events are signals, which can be absent. They usually denote discrete occurences of certain events.
Inhibition exception with an informative message. This exception is the result of signal inhibition, where no further exception information is available.
inhibitEx :: String -> SomeExceptionSource
Construct an InhibitException
wrapped in a SomeException
.
noEvent :: SomeExceptionSource
Construct an InhibitException
wrapped in a SomeException
with a
message indicating that a certain event did not happen.
Netwire Reexports
module FRP.NetWire.Analyze
module FRP.NetWire.Calculus
module FRP.NetWire.Concurrent
module FRP.NetWire.Event
module FRP.NetWire.IO
module FRP.NetWire.Random
module FRP.NetWire.Request
module FRP.NetWire.Switch
module FRP.NetWire.Tools
Other convenience reexports
module Control.Monad.IO.Class
module Control.Monad.IO.Control
module Data.Functor.Identity