netwire-4.0.2: Flexible wire arrows for FRP

MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone

Control.Wire.Types

Contents

Description

Types used in Netwire. Most notably this module implements the instances for the various reactive classes.

Synopsis

Convenient type aliases

type LastException = Last SomeExceptionSource

Monoid for the last occurred exception.

Events

type Event e m a = Wire e m a aSource

Event wires are wires that act like identity wires, but may inhibit depending on whether a certain event has occurred.

type EventM m a = WireM m a aSource

WireM equivalent of Event.

type EventP a = WireP a aSource

WireP equivalent of Event.

Wires

type WireM = Wire LastExceptionSource

Monadic wires using LastException as the inhibition monoid.

type WireP = WireM IdentitySource

Pure wires using LastException as the inhibition monoid.

Type-related utilities

as :: Monad m => Proxy a -> Wire e m a aSource

Type-restricted identity wire. This is useful to specify the type of a signal.

  • Depends: current instant.

inAs :: Proxy a -> w a b -> w a bSource

Utility to specify the input type of a wire. The argument is ignored. For types with defaulting you might prefer inLike.

 inAs (Proxy :: Proxy Double) highPeak

inLike :: a -> w a b -> w a bSource

Utility to specify the input type of a wire. The first argument is ignored. This is useful to make use of defaulting or when writing a dummy value is actually shorter.

 inLike (0 :: Double) highPeak

like :: Monad m => a -> Wire e m a aSource

Type-restricted identity wire. This is useful to specify the type of a signal. The argument is ignored.

  • Depends: current instant.

outAs :: Proxy b -> w a b -> w a bSource

Utility to specify the output type of a wire. The argument is ignored. For types with defaulting you might prefer outLike.

 outAs (Proxy :: Proxy Double) noiseM

outLike :: b -> w a b -> w a bSource

Utility to specify the output type of a wire. The first argument is ignored. This is useful to make use of defaulting or when writing a dummy value is actually shorter.

 outLike (0 :: Double) noiseM

Predefined proxies

pDouble :: Proxy DoubleSource

Double proxy for use with inAs or outAs.

pFloat :: Proxy FloatSource

Float proxy for use with inAs or outAs.

pInt :: Proxy IntSource

Int proxy for use with inAs or outAs.

pInteger :: Proxy IntegerSource

Integer proxy for use with inAs or outAs.

pString :: Proxy StringSource

String proxy for use with inAs or outAs.