netwire-3.1.0: Fast generic automaton arrow transformer for AFRP

MaintainerErtugrul Soeylemez <es@ertes.de>

Control.Wire.Types

Contents

Description

Types used in the netwire library.

Synopsis

The wire

data family Wire :: * -> (* -> * -> *) -> * -> * -> *Source

Signal networks.

type WireM e m = Wire e (Kleisli m)Source

Monad-based wires.

Construction and destruction

class Arrow >~ => WireGen (>~) whereSource

Create a wire from the given transformation computation.

Methods

mkGen :: (a >~ (Either e b, Wire e >~ a b)) -> Wire e >~ a bSource

Stateful variant.

mkFix :: Arrow >~ => (a >~ Either e b) -> Wire e >~ a bSource

Stateless variant.

Instances

Monad m => WireGen (Kleisli m) 

class Arrow >~ => WirePure (>~) whereSource

Create a pure wire from the given transformation function.

Methods

mkPure :: (a -> (Either e b, Wire e >~ a b)) -> Wire e >~ a bSource

Stateful variant.

mkPureFix :: (a -> Either e b) -> Wire e >~ a bSource

Stateless variant.

Instances

class WireToGen (>~) whereSource

Convert the given wire to a generic arrow computation.

Methods

toGen :: Wire e >~ a b -> a >~ (Either e b, Wire e >~ a b)Source

Instances

mkFixM :: Monad m => (a -> m (Either e b)) -> Wire e (Kleisli m) a bSource

Create a stateless wire from the given monadic computation.

toGenMSource

Arguments

:: Monad m 
=> Wire e (Kleisli m) a b

Wire to convert.

-> a

Input value.

-> m (Either e b, Wire e (Kleisli m) a b) 

Convert the given wire to a generic monadic computation.

Inhibition

type LastException = Last SomeExceptionSource

Convenience type for wire exceptions.

inhibitException :: Exception e => e -> LastExceptionSource

Turn an arbitrary exception to a wire exception.

inhibitMsg :: String -> LastExceptionSource

Turn a string into a userError exception wrapped by LastException.

Utilities

mapInputM :: Monad m => (a' -> a) -> Wire e (Kleisli m) a b -> Wire e (Kleisli m) a' bSource

Map a function over the input.