netwire-2.0.1: Generic automaton arrow transformer and useful tools

MaintainerErtugrul Soeylemez <es@ertes.de>

Control.Wire.Types

Contents

Description

Types used in the netwire library.

Synopsis

The wire

data Wire e (>~) a b whereSource

Signal networks.

Constructors

WGen :: !(a >~ (Either e b, Wire e >~ a b)) -> Wire e >~ a b 
WPure :: !(a -> (Either e b, Wire e >~ a b)) -> Wire e >~ a b 

Instances

(ArrowChoice >~, ArrowReader r >~) => ArrowReader r (Wire e >~)

If the underlying arrow is a reader arrow, then the wire arrow is also a reader arrow.

(ArrowChoice >~, ArrowState s >~) => ArrowState s (Wire e >~)

If the underlying arrow is a state arrow, then the wire arrow is also a state arrow.

(ArrowChoice >~, ArrowWriter w >~) => ArrowWriter w (Wire e >~)

If the underlying arrow is a writer arrow, then the wire arrow is also a writer arrow.

ArrowChoice >~ => ArrowError e (Wire e >~)

Inhibition handling interface. See also the Control.Wire.Trans.Exhibit and Control.Wire.Prefab.Event modules.

ArrowChoice >~ => ArrowTransformer (Wire e) >~

Wire arrows are arrow transformers.

ArrowChoice >~ => ArrowChoice (Wire e >~)

Support for choice (signal redirection).

(ArrowChoice >~, ArrowLoop >~) => ArrowCircuit (Wire e >~)

Support for one-instant delays.

ArrowChoice >~ => Arrow (Wire e >~)

Wire side channels.

(ArrowChoice >~, Monoid e) => ArrowZero (Wire e >~)

The always inhibiting wire. The zeroArrow is equivalent to Control.Wire.Prefab.Event.never.

(ArrowChoice >~, Monoid e) => ArrowPlus (Wire e >~)

Combining possibly inhibiting wires.

(ArrowChoice >~, ArrowLoop >~) => ArrowLoop (Wire e >~)

Value recursion in the wire arrows. **NOTE**: Wires with feedback must *never* inhibit. There is an inherent, fundamental problem with handling the inhibition case, which you will observe as a fatal pattern match error.

ArrowChoice >~ => Category (Wire e >~)

Sequencing of wires.

(Applicative f, ArrowChoice >~, ArrowIO >~) => ArrowIO (Wire (f SomeException) >~)

When the target arrow is an ArrowIO (e.g. a Kleisli arrow over IO), then the wire arrow is also an ArrowIO.

Smart construction

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

Create a wire from the given stateless transformation computation.

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

Create a wire from the given transformation computation.

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

Create a pure wire from the given transformation function.

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

Create a pure wire from the given transformation function.

Destruction

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

Convert the given wire to a generic arrow computation.