Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- type Distiller tap r s m = Tap r s (Drinker tap m)
- (+&) :: (Closable tap, Monad m) => tap m -> Drinker tap m a -> m a
- ($&) :: Monad m => tap m -> Drinker tap m a -> m a
- (++$) :: Functor m => tap m -> Distiller tap r s m -> Tap r s m
- (++&) :: Functor m => tap m -> Drinker tap m a -> m (tap m, a)
- type Still p q r s m = Distiller (Tap p q) r s m
- scanningMaybe :: (Monoid r, Monad m) => (b -> a -> b) -> b -> Still r (Maybe a) r (Maybe b) m
- filteringMaybe :: (Monoid r, Monad m) => (a -> Bool) -> Still r (Maybe a) r (Maybe a) m
- mapping :: (Monoid r, Monad m) => (a -> b) -> Still r a r b m
- traversing :: (Monoid r, Monad m) => (a -> m b) -> Still r a r b m
- filtering :: (Monoid r, Monad m) => (a -> Bool) -> Still r a r a m
- scanning :: (Monoid r, Monad m) => (b -> a -> b) -> b -> Still r a r b m

# Documentation

type Distiller tap r s m = Tap r s (Drinker tap m) Source #

`Distiller tap m r s`

is a stream transducer which has four parameters:

`tap`

input`r`

request from the downstream`s`

output`m`

underlying monad

This is also a `Tap`

.

# Special combinators

(+&) :: (Closable tap, Monad m) => tap m -> Drinker tap m a -> m a infix 6 Source #

Feed a tap to a drinker and close the used tap.

($&) :: Monad m => tap m -> Drinker tap m a -> m a infixr 7 Source #

Like (`+&`

) but discards the used tap.

($&) :: Distiller tap m r s -> Drinker (Tap r s) (Drinker tap m) a -> Drinker tap m a

# Basic combinators

(++$) :: Functor m => tap m -> Distiller tap r s m -> Tap r s m infixl 8 Source #

Attach a distiller to a tap.

Mnemonic:

`+`

Left operand is a tap.`+`

Returns a tap.`$`

Right operand is a distiller.

(++&) :: Functor m => tap m -> Drinker tap m a -> m (tap m, a) infixr 7 Source #

Connect a tap with a Drinker. Flipped `runDrinker`

.

Mnemonic:

`+`

Left operand is a tap.`+`

Returns a tap (along with the result).`&`

Right operand is a Drinker.