{-# LANGUAGE RankNTypes, Trustworthy #-}
module Pipes.Core (
Proxy
, runEffect
, respond
, (/>/)
, (//>)
, request
, (\>\)
, (>\\)
, push
, (>~>)
, (>>~)
, pull
, (>+>)
, (+>>)
, reflect
, X
, Effect
, Producer
, Pipe
, Consumer
, Client
, Server
, Effect'
, Producer'
, Consumer'
, Client'
, Server'
, (\<\)
, (/</)
, (<~<)
, (~<<)
, (<+<)
, (<\\)
, (//<)
, (<<+)
, closed
) where
import Pipes.Internal (Proxy(..), X, closed)
runEffect :: Monad m => Effect m r -> m r
runEffect :: Effect m r -> m r
runEffect = Effect m r -> m r
forall (m :: * -> *) a b' b. Monad m => Proxy X a b' X m b -> m b
go
where
go :: Proxy X a b' X m b -> m b
go Proxy X a b' X m b
p = case Proxy X a b' X m b
p of
Request X
v a -> Proxy X a b' X m b
_ -> X -> m b
forall a. X -> a
closed X
v
Respond X
v b' -> Proxy X a b' X m b
_ -> X -> m b
forall a. X -> a
closed X
v
M m (Proxy X a b' X m b)
m -> m (Proxy X a b' X m b)
m m (Proxy X a b' X m b) -> (Proxy X a b' X m b -> m b) -> m b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Proxy X a b' X m b -> m b
go
Pure b
r -> b -> m b
forall (m :: * -> *) a. Monad m => a -> m a
return b
r
{-# INLINABLE runEffect #-}
infixl 3 //>
infixr 3 <\\
infixr 4 />/, >\\
infixl 4 \<\, //<
infixl 5 \>\
infixr 5 /</
infixl 6 <<+
infixr 6 +>>
infixl 7 >+>, >>~
infixr 7 <+<, ~<<
infixl 8 <~<
infixr 8 >~>
respond :: Functor m => a -> Proxy x' x a' a m a'
respond :: a -> Proxy x' x a' a m a'
respond a
a = a -> (a' -> Proxy x' x a' a m a') -> Proxy x' x a' a m a'
forall a' a b' b (m :: * -> *) r.
b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Respond a
a a' -> Proxy x' x a' a m a'
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure
{-# INLINABLE [1] respond #-}
(/>/)
:: Functor m
=> (a -> Proxy x' x b' b m a')
-> (b -> Proxy x' x c' c m b')
-> (a -> Proxy x' x c' c m a')
(a -> Proxy x' x b' b m a'
fa />/ :: (a -> Proxy x' x b' b m a')
-> (b -> Proxy x' x c' c m b') -> a -> Proxy x' x c' c m a'
/>/ b -> Proxy x' x c' c m b'
fb) a
a = a -> Proxy x' x b' b m a'
fa a
a Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b') -> Proxy x' x c' c m a'
forall (m :: * -> *) x' x b' b a' c' c.
Functor m =>
Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b') -> Proxy x' x c' c m a'
//> b -> Proxy x' x c' c m b'
fb
{-# INLINABLE (/>/) #-}
(//>)
:: Functor m
=> Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b')
-> Proxy x' x c' c m a'
Proxy x' x b' b m a'
p0 //> :: Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b') -> Proxy x' x c' c m a'
//> b -> Proxy x' x c' c m b'
fb = Proxy x' x b' b m a' -> Proxy x' x c' c m a'
forall r. Proxy x' x b' b m r -> Proxy x' x c' c m r
go Proxy x' x b' b m a'
p0
where
go :: Proxy x' x b' b m r -> Proxy x' x c' c m r
go Proxy x' x b' b m r
p = case Proxy x' x b' b m r
p of
Request x'
x' x -> Proxy x' x b' b m r
fx -> x' -> (x -> Proxy x' x c' c m r) -> Proxy x' x c' c m r
forall a' a b' b (m :: * -> *) r.
a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Request x'
x' (\x
x -> Proxy x' x b' b m r -> Proxy x' x c' c m r
go (x -> Proxy x' x b' b m r
fx x
x))
Respond b
b b' -> Proxy x' x b' b m r
fb' -> b -> Proxy x' x c' c m b'
fb b
b Proxy x' x c' c m b'
-> (b' -> Proxy x' x c' c m r) -> Proxy x' x c' c m r
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \b'
b' -> Proxy x' x b' b m r -> Proxy x' x c' c m r
go (b' -> Proxy x' x b' b m r
fb' b'
b')
M m (Proxy x' x b' b m r)
m -> m (Proxy x' x c' c m r) -> Proxy x' x c' c m r
forall a' a b' b (m :: * -> *) r.
m (Proxy a' a b' b m r) -> Proxy a' a b' b m r
M (Proxy x' x b' b m r -> Proxy x' x c' c m r
go (Proxy x' x b' b m r -> Proxy x' x c' c m r)
-> m (Proxy x' x b' b m r) -> m (Proxy x' x c' c m r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m (Proxy x' x b' b m r)
m)
Pure r
a -> r -> Proxy x' x c' c m r
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure r
a
{-# INLINE [1] (//>) #-}
{-# RULES
"(Request x' fx ) //> fb" forall x' fx fb .
(Request x' fx ) //> fb = Request x' (\x -> fx x //> fb);
"(Respond b fb') //> fb" forall b fb' fb .
(Respond b fb') //> fb = fb b >>= \b' -> fb' b' //> fb;
"(M m ) //> fb" forall m fb .
(M m ) //> fb = M ((\p' -> p' //> fb) <$> m);
"(Pure a ) //> fb" forall a fb .
(Pure a ) //> fb = Pure a;
#-}
request :: Functor m => a' -> Proxy a' a y' y m a
request :: a' -> Proxy a' a y' y m a
request a'
a' = a' -> (a -> Proxy a' a y' y m a) -> Proxy a' a y' y m a
forall a' a b' b (m :: * -> *) r.
a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Request a'
a' a -> Proxy a' a y' y m a
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure
{-# INLINABLE [1] request #-}
(\>\)
:: Functor m
=> (b' -> Proxy a' a y' y m b)
-> (c' -> Proxy b' b y' y m c)
-> (c' -> Proxy a' a y' y m c)
(b' -> Proxy a' a y' y m b
fb' \>\ :: (b' -> Proxy a' a y' y m b)
-> (c' -> Proxy b' b y' y m c) -> c' -> Proxy a' a y' y m c
\>\ c' -> Proxy b' b y' y m c
fc') c'
c' = b' -> Proxy a' a y' y m b
fb' (b' -> Proxy a' a y' y m b)
-> Proxy b' b y' y m c -> Proxy a' a y' y m c
forall (m :: * -> *) b' a' a y' y b c.
Functor m =>
(b' -> Proxy a' a y' y m b)
-> Proxy b' b y' y m c -> Proxy a' a y' y m c
>\\ c' -> Proxy b' b y' y m c
fc' c'
c'
{-# INLINABLE (\>\) #-}
(>\\)
:: Functor m
=> (b' -> Proxy a' a y' y m b)
-> Proxy b' b y' y m c
-> Proxy a' a y' y m c
b' -> Proxy a' a y' y m b
fb' >\\ :: (b' -> Proxy a' a y' y m b)
-> Proxy b' b y' y m c -> Proxy a' a y' y m c
>\\ Proxy b' b y' y m c
p0 = Proxy b' b y' y m c -> Proxy a' a y' y m c
forall r. Proxy b' b y' y m r -> Proxy a' a y' y m r
go Proxy b' b y' y m c
p0
where
go :: Proxy b' b y' y m r -> Proxy a' a y' y m r
go Proxy b' b y' y m r
p = case Proxy b' b y' y m r
p of
Request b'
b' b -> Proxy b' b y' y m r
fb -> b' -> Proxy a' a y' y m b
fb' b'
b' Proxy a' a y' y m b
-> (b -> Proxy a' a y' y m r) -> Proxy a' a y' y m r
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \b
b -> Proxy b' b y' y m r -> Proxy a' a y' y m r
go (b -> Proxy b' b y' y m r
fb b
b)
Respond y
x y' -> Proxy b' b y' y m r
fx' -> y -> (y' -> Proxy a' a y' y m r) -> Proxy a' a y' y m r
forall a' a b' b (m :: * -> *) r.
b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Respond y
x (\y'
x' -> Proxy b' b y' y m r -> Proxy a' a y' y m r
go (y' -> Proxy b' b y' y m r
fx' y'
x'))
M m (Proxy b' b y' y m r)
m -> m (Proxy a' a y' y m r) -> Proxy a' a y' y m r
forall a' a b' b (m :: * -> *) r.
m (Proxy a' a b' b m r) -> Proxy a' a b' b m r
M (Proxy b' b y' y m r -> Proxy a' a y' y m r
go (Proxy b' b y' y m r -> Proxy a' a y' y m r)
-> m (Proxy b' b y' y m r) -> m (Proxy a' a y' y m r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m (Proxy b' b y' y m r)
m)
Pure r
a -> r -> Proxy a' a y' y m r
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure r
a
{-# INLINE [1] (>\\) #-}
{-# RULES
"fb' >\\ (Request b' fb )" forall fb' b' fb .
fb' >\\ (Request b' fb ) = fb' b' >>= \b -> fb' >\\ fb b;
"fb' >\\ (Respond x fx')" forall fb' x fx' .
fb' >\\ (Respond x fx') = Respond x (\x' -> fb' >\\ fx' x');
"fb' >\\ (M m )" forall fb' m .
fb' >\\ (M m ) = M ((\p' -> fb' >\\ p') <$> m);
"fb' >\\ (Pure a )" forall fb' a .
fb' >\\ (Pure a ) = Pure a;
#-}
push :: Functor m => a -> Proxy a' a a' a m r
push :: a -> Proxy a' a a' a m r
push = a -> Proxy a' a a' a m r
forall a a' (m :: * -> *) r. a -> Proxy a' a a' a m r
go
where
go :: a -> Proxy a' a a' a m r
go a
a = a -> (a' -> Proxy a' a a' a m r) -> Proxy a' a a' a m r
forall a' a b' b (m :: * -> *) r.
b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Respond a
a (\a'
a' -> a' -> (a -> Proxy a' a a' a m r) -> Proxy a' a a' a m r
forall a' a b' b (m :: * -> *) r.
a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Request a'
a' a -> Proxy a' a a' a m r
go)
{-# INLINABLE [1] push #-}
(>~>)
:: Functor 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)
(_a -> Proxy a' a b' b m r
fa >~> :: (_a -> Proxy a' a b' b m r)
-> (b -> Proxy b' b c' c m r) -> _a -> Proxy a' a c' c m r
>~> b -> Proxy b' b c' c m r
fb) _a
a = _a -> Proxy a' a b' b m r
fa _a
a Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
forall (m :: * -> *) a' a b' b r c' c.
Functor m =>
Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
>>~ b -> Proxy b' b c' c m r
fb
{-# INLINABLE (>~>) #-}
(>>~)
:: Functor m
=> Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r)
-> Proxy a' a c' c m r
Proxy a' a b' b m r
p >>~ :: Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
>>~ b -> Proxy b' b c' c m r
fb = case Proxy a' a b' b m r
p of
Request a'
a' a -> Proxy a' a b' b m r
fa -> a' -> (a -> Proxy a' a c' c m r) -> Proxy a' a c' c m r
forall a' a b' b (m :: * -> *) r.
a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Request a'
a' (\a
a -> a -> Proxy a' a b' b m r
fa a
a Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
forall (m :: * -> *) a' a b' b r c' c.
Functor m =>
Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
>>~ b -> Proxy b' b c' c m r
fb)
Respond b
b b' -> Proxy a' a b' b m r
fb' -> b' -> Proxy a' a b' b m r
fb' (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
forall (m :: * -> *) b' a' a b r c' c.
Functor m =>
(b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
+>> b -> Proxy b' b c' c m r
fb b
b
M m (Proxy a' a b' b m r)
m -> m (Proxy a' a c' c m r) -> Proxy a' a c' c m r
forall a' a b' b (m :: * -> *) r.
m (Proxy a' a b' b m r) -> Proxy a' a b' b m r
M ((\Proxy a' a b' b m r
p' -> Proxy a' a b' b m r
p' Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
forall (m :: * -> *) a' a b' b r c' c.
Functor m =>
Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
>>~ b -> Proxy b' b c' c m r
fb) (Proxy a' a b' b m r -> Proxy a' a c' c m r)
-> m (Proxy a' a b' b m r) -> m (Proxy a' a c' c m r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m (Proxy a' a b' b m r)
m)
Pure r
r -> r -> Proxy a' a c' c m r
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure r
r
{-# INLINE [1] (>>~) #-}
pull :: Functor m => a' -> Proxy a' a a' a m r
pull :: a' -> Proxy a' a a' a m r
pull = a' -> Proxy a' a a' a m r
forall b' b (m :: * -> *) r. b' -> Proxy b' b b' b m r
go
where
go :: b' -> Proxy b' b b' b m r
go b'
a' = b' -> (b -> Proxy b' b b' b m r) -> Proxy b' b b' b m r
forall a' a b' b (m :: * -> *) r.
a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Request b'
a' (\b
a -> b -> (b' -> Proxy b' b b' b m r) -> Proxy b' b b' b m r
forall a' a b' b (m :: * -> *) r.
b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Respond b
a b' -> Proxy b' b b' b m r
go)
{-# INLINABLE [1] pull #-}
(>+>)
:: Functor 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)
(b' -> Proxy a' a b' b m r
fb' >+> :: (b' -> Proxy a' a b' b m r)
-> (_c' -> Proxy b' b c' c m r) -> _c' -> Proxy a' a c' c m r
>+> _c' -> Proxy b' b c' c m r
fc') _c'
c' = b' -> Proxy a' a b' b m r
fb' (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
forall (m :: * -> *) b' a' a b r c' c.
Functor m =>
(b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
+>> _c' -> Proxy b' b c' c m r
fc' _c'
c'
{-# INLINABLE (>+>) #-}
(+>>)
:: Functor m
=> (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r
-> Proxy a' a c' c m r
b' -> Proxy a' a b' b m r
fb' +>> :: (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
+>> Proxy b' b c' c m r
p = case Proxy b' b c' c m r
p of
Request b'
b' b -> Proxy b' b c' c m r
fb -> b' -> Proxy a' a b' b m r
fb' b'
b' Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
forall (m :: * -> *) a' a b' b r c' c.
Functor m =>
Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
>>~ b -> Proxy b' b c' c m r
fb
Respond c
c c' -> Proxy b' b c' c m r
fc' -> c -> (c' -> Proxy a' a c' c m r) -> Proxy a' a c' c m r
forall a' a b' b (m :: * -> *) r.
b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Respond c
c (\c'
c' -> b' -> Proxy a' a b' b m r
fb' (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
forall (m :: * -> *) b' a' a b r c' c.
Functor m =>
(b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
+>> c' -> Proxy b' b c' c m r
fc' c'
c')
M m (Proxy b' b c' c m r)
m -> m (Proxy a' a c' c m r) -> Proxy a' a c' c m r
forall a' a b' b (m :: * -> *) r.
m (Proxy a' a b' b m r) -> Proxy a' a b' b m r
M ((\Proxy b' b c' c m r
p' -> b' -> Proxy a' a b' b m r
fb' (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
forall (m :: * -> *) b' a' a b r c' c.
Functor m =>
(b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
+>> Proxy b' b c' c m r
p') (Proxy b' b c' c m r -> Proxy a' a c' c m r)
-> m (Proxy b' b c' c m r) -> m (Proxy a' a c' c m r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m (Proxy b' b c' c m r)
m)
Pure r
r -> r -> Proxy a' a c' c m r
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure r
r
{-# INLINABLE [1] (+>>) #-}
reflect :: Functor m => Proxy a' a b' b m r -> Proxy b b' a a' m r
reflect :: Proxy a' a b' b m r -> Proxy b b' a a' m r
reflect = Proxy a' a b' b m r -> Proxy b b' a a' m r
forall (m :: * -> *) b b' a a' r.
Functor m =>
Proxy b b' a a' m r -> Proxy a' a b' b m r
go
where
go :: Proxy b b' a a' m r -> Proxy a' a b' b m r
go Proxy b b' a a' m r
p = case Proxy b b' a a' m r
p of
Request b
a' b' -> Proxy b b' a a' m r
fa -> b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
forall a' a b' b (m :: * -> *) r.
b -> (b' -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Respond b
a' (\b'
a -> Proxy b b' a a' m r -> Proxy a' a b' b m r
go (b' -> Proxy b b' a a' m r
fa b'
a ))
Respond a'
b a -> Proxy b b' a a' m r
fb' -> a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
forall a' a b' b (m :: * -> *) r.
a' -> (a -> Proxy a' a b' b m r) -> Proxy a' a b' b m r
Request a'
b (\a
b' -> Proxy b b' a a' m r -> Proxy a' a b' b m r
go (a -> Proxy b b' a a' m r
fb' a
b'))
M m (Proxy b b' a a' m r)
m -> m (Proxy a' a b' b m r) -> Proxy a' a b' b m r
forall a' a b' b (m :: * -> *) r.
m (Proxy a' a b' b m r) -> Proxy a' a b' b m r
M (Proxy b b' a a' m r -> Proxy a' a b' b m r
go (Proxy b b' a a' m r -> Proxy a' a b' b m r)
-> m (Proxy b b' a a' m r) -> m (Proxy a' a b' b m r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m (Proxy b b' a a' m r)
m)
Pure r
r -> r -> Proxy a' a b' b m r
forall a' a b' b (m :: * -> *) r. r -> Proxy a' a b' b m r
Pure r
r
{-# INLINABLE reflect #-}
type Effect = Proxy X () () X
type Producer b = Proxy X () () b
type Pipe a b = Proxy () a () b
type Consumer a = Proxy () a () X
type Client a' a = Proxy a' a () X
type Server b' b = Proxy X () b' b
type Effect' m r = forall x' x y' y . Proxy x' x y' y m r
type Producer' b m r = forall x' x . Proxy x' x () b m r
type Consumer' a m r = forall y' y . Proxy () a 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
(\<\)
:: Functor m
=> (b -> Proxy x' x c' c m b')
-> (a -> Proxy x' x b' b m a')
-> (a -> Proxy x' x c' c m a')
b -> Proxy x' x c' c m b'
p1 \<\ :: (b -> Proxy x' x c' c m b')
-> (a -> Proxy x' x b' b m a') -> a -> Proxy x' x c' c m a'
\<\ a -> Proxy x' x b' b m a'
p2 = a -> Proxy x' x b' b m a'
p2 (a -> Proxy x' x b' b m a')
-> (b -> Proxy x' x c' c m b') -> a -> Proxy x' x c' c m a'
forall (m :: * -> *) a x' x b' b a' c' c.
Functor m =>
(a -> Proxy x' x b' b m a')
-> (b -> Proxy x' x c' c m b') -> a -> Proxy x' x c' c m a'
/>/ b -> Proxy x' x c' c m b'
p1
{-# INLINABLE (\<\) #-}
(/</)
:: Functor m
=> (c' -> Proxy b' b x' x m c)
-> (b' -> Proxy a' a x' x m b)
-> (c' -> Proxy a' a x' x m c)
c' -> Proxy b' b x' x m c
p1 /</ :: (c' -> Proxy b' b x' x m c)
-> (b' -> Proxy a' a x' x m b) -> c' -> Proxy a' a x' x m c
/</ b' -> Proxy a' a x' x m b
p2 = b' -> Proxy a' a x' x m b
p2 (b' -> Proxy a' a x' x m b)
-> (c' -> Proxy b' b x' x m c) -> c' -> Proxy a' a x' x m c
forall (m :: * -> *) b' a' a y' y b c' c.
Functor m =>
(b' -> Proxy a' a y' y m b)
-> (c' -> Proxy b' b y' y m c) -> c' -> Proxy a' a y' y m c
\>\ c' -> Proxy b' b x' x m c
p1
{-# INLINABLE (/</) #-}
(<~<)
:: Functor m
=> (b -> Proxy b' b c' c m r)
-> (a -> Proxy a' a b' b m r)
-> (a -> Proxy a' a c' c m r)
b -> Proxy b' b c' c m r
p1 <~< :: (b -> Proxy b' b c' c m r)
-> (a -> Proxy a' a b' b m r) -> a -> Proxy a' a c' c m r
<~< a -> Proxy a' a b' b m r
p2 = a -> Proxy a' a b' b m r
p2 (a -> Proxy a' a b' b m r)
-> (b -> Proxy b' b c' c m r) -> a -> Proxy a' a c' c m r
forall (m :: * -> *) _a a' a b' b r c' c.
Functor 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
>~> b -> Proxy b' b c' c m r
p1
{-# INLINABLE (<~<) #-}
(<+<)
:: Functor m
=> (c' -> Proxy b' b c' c m r)
-> (b' -> Proxy a' a b' b m r)
-> (c' -> Proxy a' a c' c m r)
c' -> Proxy b' b c' c m r
p1 <+< :: (c' -> Proxy b' b c' c m r)
-> (b' -> Proxy a' a b' b m r) -> c' -> Proxy a' a c' c m r
<+< b' -> Proxy a' a b' b m r
p2 = b' -> Proxy a' a b' b m r
p2 (b' -> Proxy a' a b' b m r)
-> (c' -> Proxy b' b c' c m r) -> c' -> Proxy a' a c' c m r
forall (m :: * -> *) b' a' a b r _c' c' c.
Functor 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
>+> c' -> Proxy b' b c' c m r
p1
{-# INLINABLE (<+<) #-}
(<\\)
:: Functor m
=> (b -> Proxy x' x c' c m b')
-> Proxy x' x b' b m a'
-> Proxy x' x c' c m a'
b -> Proxy x' x c' c m b'
f <\\ :: (b -> Proxy x' x c' c m b')
-> Proxy x' x b' b m a' -> Proxy x' x c' c m a'
<\\ Proxy x' x b' b m a'
p = Proxy x' x b' b m a'
p Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b') -> Proxy x' x c' c m a'
forall (m :: * -> *) x' x b' b a' c' c.
Functor m =>
Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b') -> Proxy x' x c' c m a'
//> b -> Proxy x' x c' c m b'
f
{-# INLINABLE (<\\) #-}
(//<)
:: Functor m
=> Proxy b' b y' y m c
-> (b' -> Proxy a' a y' y m b)
-> Proxy a' a y' y m c
Proxy b' b y' y m c
p //< :: Proxy b' b y' y m c
-> (b' -> Proxy a' a y' y m b) -> Proxy a' a y' y m c
//< b' -> Proxy a' a y' y m b
f = b' -> Proxy a' a y' y m b
f (b' -> Proxy a' a y' y m b)
-> Proxy b' b y' y m c -> Proxy a' a y' y m c
forall (m :: * -> *) b' a' a y' y b c.
Functor m =>
(b' -> Proxy a' a y' y m b)
-> Proxy b' b y' y m c -> Proxy a' a y' y m c
>\\ Proxy b' b y' y m c
p
{-# INLINABLE (//<) #-}
(~<<)
:: Functor m
=> (b -> Proxy b' b c' c m r)
-> Proxy a' a b' b m r
-> Proxy a' a c' c m r
b -> Proxy b' b c' c m r
k ~<< :: (b -> Proxy b' b c' c m r)
-> Proxy a' a b' b m r -> Proxy a' a c' c m r
~<< Proxy a' a b' b m r
p = Proxy a' a b' b m r
p Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
forall (m :: * -> *) a' a b' b r c' c.
Functor m =>
Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r) -> Proxy a' a c' c m r
>>~ b -> Proxy b' b c' c m r
k
{-# INLINABLE (~<<) #-}
(<<+)
:: Functor m
=> Proxy b' b c' c m r
-> (b' -> Proxy a' a b' b m r)
-> Proxy a' a c' c m r
Proxy b' b c' c m r
k <<+ :: Proxy b' b c' c m r
-> (b' -> Proxy a' a b' b m r) -> Proxy a' a c' c m r
<<+ b' -> Proxy a' a b' b m r
p = b' -> Proxy a' a b' b m r
p (b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
forall (m :: * -> *) b' a' a b r c' c.
Functor m =>
(b' -> Proxy a' a b' b m r)
-> Proxy b' b c' c m r -> Proxy a' a c' c m r
+>> Proxy b' b c' c m r
k
{-# INLINABLE (<<+) #-}
{-# RULES
"(p //> f) //> g" forall p f g . (p //> f) //> g = p //> (\x -> f x //> g)
; "p //> respond" forall p . p //> respond = p
; "respond x //> f" forall x f . respond x //> f = f x
; "f >\\ (g >\\ p)" forall f g p . f >\\ (g >\\ p) = (\x -> f >\\ g x) >\\ p
; "request >\\ p" forall p . request >\\ p = p
; "f >\\ request x" forall f x . f >\\ request x = f x
; "(p >>~ f) >>~ g" forall p f g . (p >>~ f) >>~ g = p >>~ (\x -> f x >>~ g)
; "p >>~ push" forall p . p >>~ push = p
; "push x >>~ f" forall x f . push x >>~ f = f x
; "f +>> (g +>> p)" forall f g p . f +>> (g +>> p) = (\x -> f +>> g x) +>> p
; "pull +>> p" forall p . pull +>> p = p
; "f +>> pull x" forall f x . f +>> pull x = f x
#-}