netwire-4.0.1: Flexible wire arrows for FRP

Copyright(c) 2012 Ertugrul Soeylemez
LicenseBSD3
MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone
LanguageHaskell2010

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 SomeException Source

Monoid for the last occurred exception.

Events

type Event e m a = Wire e m a a Source

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 a Source

WireM equivalent of Event.

type EventP a = WireP a a Source

WireP equivalent of Event.

Wires

type WireM = Wire LastException Source

Monadic wires using LastException as the inhibition monoid.

type WireP = WireM Identity Source

Pure wires using LastException as the inhibition monoid.

Type-related utilities

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

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 b Source

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 b Source

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 a Source

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 b Source

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 b Source

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 Double Source

Double proxy for use with inAs or outAs.

pFloat :: Proxy Float Source

Float proxy for use with inAs or outAs.

pInt :: Proxy Int Source

Int proxy for use with inAs or outAs.

pInteger :: Proxy Integer Source

Integer proxy for use with inAs or outAs.

pString :: Proxy String Source

String proxy for use with inAs or outAs.