generator-0.5.2: Python-generators notation for creation of monadic listsSource codeContentsIndex
Control.Monad.Consumer
Description

A monad transformer for the [partial] consumption of Lists. The interface closely mimics iterators in languages such as Python.

It is often nicer to avoid using Consumer and to use folds and higher-order functions instead.

Synopsis
data ConsumerT v m a
evalConsumerT :: List l => ConsumerT v (ItemM l) a -> l v -> ItemM l a
next :: Monad m => ConsumerT v m (Maybe v)
consumeRestM :: Monad m => ConsumerT a m b -> ConsumerT a m (m b)
Documentation
data ConsumerT v m a Source
A monad tranformer for consuming Lists.
show/hide Instances
evalConsumerT :: List l => ConsumerT v (ItemM l) a -> l v -> ItemM l aSource
Consume a ListT
next :: Monad m => ConsumerT v m (Maybe v)Source
Consume/get the next value
consumeRestM :: Monad m => ConsumerT a m b -> ConsumerT a m (m b)Source
Return an instance of the underlying monad that will use the given ConsumerT to consume the remaining values. After this action there are no more items to consume (they belong to the given ConsumerT now)
Produced by Haddock version 2.4.2