Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|
Types used in the netwire library.
- data family Wire :: * -> (* -> * -> *) -> * -> * -> *
- type WireM e m = Wire e (Kleisli m)
- class Arrow >~ => WireGen (>~) where
- class Arrow >~ => WirePure (>~) where
- class WireToGen (>~) where
- mkFixM :: Monad m => (a -> m (Either e b)) -> Wire e (Kleisli m) a b
- toGenM :: Monad m => Wire e (Kleisli m) a b -> a -> m (Either e b, Wire e (Kleisli m) a b)
- type LastException = Last SomeException
- inhibitException :: Exception e => e -> LastException
- inhibitMsg :: String -> LastException
- mapInputM :: Monad m => (a' -> a) -> Wire e (Kleisli m) a b -> Wire e (Kleisli m) a' b
The wire
Construction and destruction
class Arrow >~ => WireGen (>~) whereSource
Create a wire from the given transformation computation.
class Arrow >~ => WirePure (>~) whereSource
Create a pure wire from the given transformation function.
mkFixM :: Monad m => (a -> m (Either e b)) -> Wire e (Kleisli m) a bSource
Create a stateless wire from the given monadic computation.
:: Monad m | |
=> Wire e (Kleisli m) a b | Wire to convert. |
-> a | Input value. |
-> m (Either e b, Wire e (Kleisli m) a b) |
Convert the given wire to a generic monadic computation.
Inhibition
type LastException = Last SomeExceptionSource
Convenience type for wire exceptions.
inhibitException :: Exception e => e -> LastExceptionSource
Turn an arbitrary exception to a wire exception.
inhibitMsg :: String -> LastExceptionSource
Turn a string into a userError
exception wrapped by
LastException
.