drinkery-0.4: Boozy streaming library

Safe HaskellSafe
LanguageHaskell2010

Data.Drinkery.Finite

Synopsis

Documentation

type Source r s = Tap r (Maybe s) Source #

Finite source

type Converter p q r s m = Source r s (Sink (Source p q) m) Source #

Mono in/out

type Pipe a b m = forall r. (Monoid r, Semigroup r) => Converter r a r b m Source #

scan :: Monad m => (b -> a -> b) -> b -> Pipe a b m Source #

reserve :: (Monoid r, MonadSink (Source r s) m) => (s -> Producer r (Maybe t) m ()) -> Producer r (Maybe t) m () Source #

map :: (Functor t, Monad m) => (a -> b) -> Distiller (Tap r (t a)) r (t b) m Source #

map' :: (Functor t, Monad m) => (a -> b) -> Distiller (Tap r (t a)) r (t b) m Source #

concatMap :: (Foldable f, Monad m) => (a -> f b) -> Pipe a b m Source #

filter :: Monad m => (a -> Bool) -> Pipe a a m Source #

mapAccum :: Monad m => (s -> a -> (s, b)) -> s -> Pipe a b m Source #

traverse :: Monad m => (a -> m b) -> Pipe a b m Source #

take :: Monad m => Int -> Pipe a a m Source #

drop :: Monad m => Int -> Pipe a a m Source #

takeWhile :: Monad m => (a -> Bool) -> Pipe a a m Source #

dropWhile :: Monad m => (a -> Bool) -> Pipe a a m Source #

drinkUp :: (Monoid r, Semigroup r, MonadSink (Tap r (Maybe s)) m) => m [s] Source #

Consume all the content of a Tap and return the elements as a list.