netwire-2.0.1: Generic automaton arrow transformer and useful tools

MaintainerErtugrul Soeylemez <es@ertes.de>

Control.Wire.Classes

Contents

Description

Type classes used in Netwire.

Synopsis

Various effects

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

Arrows with a clock.

Associated Types

type Time (>~) Source

Type for time values.

Methods

arrTime :: a >~ Time >~Source

Current time in some arrow-specific frame of reference.

Instances

ArrowClock (Kleisli IO)

Instance for the system time. Use this only for testing. This is intentionally specific to allow you to define better instances with custom arrows.

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

Arrows which support running IO computations.

Methods

arrIO :: IO b >~ bSource

Run the input IO computation and output its result.

Instances

MonadIO m => ArrowIO (Kleisli m) 
(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.

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

Arrows with support for random number generation.

Methods

arrRand :: Random b => a >~ bSource

Return a random number.

arrRandR :: Random b => (b, b) >~ bSource

Return a random number in the input range.

Instances

ArrowRandom (Kleisli IO)

Instance for the IO-builtin StdGen.