Help us understand the problem. What is going on with this article?

# Pipesライブラリ　超図解

pipesライブラリを図解します。

## Proxy a' a b' b m r

Pipes.Internalより
```data Proxy a' a b' b m r
= Request a' (a  -> Proxy a' a b' b m r )
| Respond b  (b' -> Proxy a' a b' b m r )
| M          (m    (Proxy a' a b' b m r))
| Pure    r
```

## fb' +>> p

Pipes.Coreより
```(+>>)
=> (b' -> Proxy a' a b' b m r)
->        Proxy b' b c' c m r
->        Proxy a' a c' c m r
fb' +>> p = case p of
Request b' fb  -> fb' b' >>~ fb
Respond c  fc' -> Respond c (\c' -> fb' +>> fc' c')
M          m   -> M (m >>= \p' -> return (fb' +>> p'))
Pure       r   -> Pure r
```

## p >>~ fa

Pipes.Coreより
```(>>~)
=>       Proxy a' a b' b m r
-> (b -> Proxy b' b c' c m r)
->       Proxy a' a c' c m r
p >>~ fb = case p of
Request a' fa  -> Request a' (\a -> fa a >>~ fb)
Respond b  fb' -> fb' +>> fb b
M          m   -> M (m >>= \p' -> return (p' >>~ fb))
Pure       r   -> Pure r
```

## fb' >\\ p

Pipes.Coreより
```(>\\)
=> (b' -> Proxy a' a y' y m b)
->        Proxy b' b y' y m c
->        Proxy a' a y' y m c
fb' >\\ p0 = go p0
where
go p = case p of
Request b' fb  -> fb' b' >>= \b -> go (fb b)
Respond x  fx' -> Respond x (\x' -> go (fx' x'))
M          m   -> M (m >>= \p' -> return (go p'))
Pure       a   -> Pure a
```

## p //> fa

Pipes.Coreより
```(//>)
=>       Proxy x' x b' b m a'
-> (b -> Proxy x' x c' c m b')
->       Proxy x' x c' c m a'
p0 //> fb = go p0
where
go p = case p of
Request x' fx  -> Request x' (\x -> go (fx x))
Respond b  fb' -> fb b >>= \b' -> go (fb' b')
M          m   -> M (m >>= \p' -> return (go p'))
Pure       a   -> Pure a
```

Why not register and get more from Qiita?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away