Copyright | (C) 2015 Yorick Laupa Gabriel Gonzalez |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Yorick Laupa <yo.eight@gmail.com> |
Stability | provisional |
Portability | Rank-2 Types, GADTs |
Safe Haskell | None |
Language | Haskell2010 |
Allows bidirectional communication between two MachineT. Exposed the same interface of Pipes library.
- data Exchange a' a b' b c where
- type Proxy a' a b' b m c = MachineT m (Exchange a' a b' b) c
- type Effect m r = Proxy Void () () Void m r
- type Client a' a m r = Proxy a' a () Void m r
- type Server b' b m r = Proxy Void () b' b m r
- type Effect' m r = forall x' x y' y. Proxy x' x y' y m r
- type Server' b' b m r = forall x' x. Proxy x' x b' b m r
- type Client' a' a m r = forall y' y. Proxy a' a y' y m r
- request :: a' -> PlanT (Exchange a' a y' y) o m a
- respond :: a -> PlanT (Exchange x' x a' a) o m a'
- push :: Monad m => a -> Proxy a' a a' a m r
- (>~>) :: Monad m => (_a -> Proxy a' a b' b m r) -> (b -> Proxy b' b c' c m r) -> _a -> Proxy a' a c' c m r
- (>>~) :: Monad m => Proxy a' a b' b m r -> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
- pull :: Monad m => a' -> Proxy a' a a' a m r
- (>+>) :: Monad m => (b' -> Proxy a' a b' b m r) -> (_c' -> Proxy b' b c' c m r) -> _c' -> Proxy a' a c' c m r
- (+>>) :: Monad m => (b' -> Proxy a' a b' b m r) -> Proxy b' b c' c m r -> Proxy a' a c' c m r
- absurdExchange :: Exchange Void a b Void t -> c
- runEffect :: Monad m => Effect m o -> m [o]
- runEffect_ :: Monad m => Effect m o -> m ()
Documentation
type Effect' m r = forall x' x y' y. Proxy x' x y' y m r Source #
Like Effect
, but with a polymorphic type
type Server' b' b m r = forall x' x. Proxy x' x b' b m r Source #
Like Server
, but with a polymorphic type
type Client' a' a m r = forall y' y. Proxy a' a y' y m r Source #
Like Client
, but with a polymorphic type
request :: a' -> PlanT (Exchange a' a y' y) o m a Source #
Send a value of type a' upstream and block waiting for a reply of type a.
request
is the identity of the request category.
respond :: a -> PlanT (Exchange x' x a' a) o m a' Source #
Send a value of type a downstream and block waiting for a reply of type a'
respond
is the identity of the respond category.
push :: Monad m => a -> Proxy a' a a' a m r Source #
Forward responses followed by requests.
push
is the identity of the push category.
(>~>) :: Monad m => (_a -> Proxy a' a b' b m r) -> (b -> Proxy b' b c' c m r) -> _a -> Proxy a' a c' c m r infixl 8 Source #
(>>~) :: Monad m => Proxy a' a b' b m r -> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r infixl 7 Source #
pull :: Monad m => a' -> Proxy a' a a' a m r Source #
Forward requests followed by responses.
pull
is the identity of the pull category.
(>+>) :: Monad m => (b' -> Proxy a' a b' b m r) -> (_c' -> Proxy b' b c' c m r) -> _c' -> Proxy a' a c' c m r infixl 7 Source #
(+>>) :: Monad m => (b' -> Proxy a' a b' b m r) -> Proxy b' b c' c m r -> Proxy a' a c' c m r infixr 6 Source #