Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|---|
Safe Haskell | None |
Types used in Netwire. Most notably this module implements the instances for the various reactive classes.
- type LastException = Last SomeException
- type Event e m a = Wire e m a a
- type EventM m a = WireM m a a
- type EventP a = WireP a a
- type WireM = Wire LastException
- type WireP = WireM Identity
- as :: Monad m => Proxy a -> Wire e m a a
- inAs :: Proxy a -> w a b -> w a b
- inLike :: a -> w a b -> w a b
- like :: Monad m => a -> Wire e m a a
- outAs :: Proxy b -> w a b -> w a b
- outLike :: b -> w a b -> w a b
- pDouble :: Proxy Double
- pFloat :: Proxy Float
- pInt :: Proxy Int
- pInteger :: Proxy Integer
- pString :: Proxy String
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.
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