Safe Haskell | None |
---|---|
Language | Haskell98 |
- newtype Fold' b e a = Fold' (Lift (Fold'_ b e) a)
- data Fold'_ b e a
- nonexhaustiveCont :: Fold'_ b e a -> Producer b IO () -> IO (Either e a)
- exhaustiveCont :: Fold'_ b e a -> Producer b IO r -> IO (Either e (a, r))
- withFallibleCont :: (Producer b IO () -> IO (Either e a)) -> Fold' b e a
- withFallibleCont' :: (forall r. Producer b IO r -> IO (Either e (a, r))) -> Fold' b e a
- withCont :: (Producer b IO () -> IO a) -> Fold' b e a
- withCont' :: (forall r. Producer b IO r -> IO (a, r)) -> Fold' b e a
- withFold :: Fold b a -> Fold' b e a
- withFoldIO :: FoldM IO b a -> Fold' b e a
- hoistFold :: Monad m => (forall a. m a -> n a) -> FoldM m i r -> FoldM n i r
- withFallibleFold :: FoldM (ExceptT e IO) b a -> Fold' b e a
- withConsumer :: Consumer b IO () -> Fold' b e ()
- withConsumer' :: Consumer b IO Void -> Fold' b e ()
- withConsumerM :: MonadIO m => (m () -> IO (Either e a)) -> Consumer b m () -> Fold' b e a
- withConsumerM' :: MonadIO m => (forall r. m r -> IO (Either e (a, r))) -> Consumer b m Void -> Fold' b e a
- withSafeConsumer :: Consumer b (SafeT IO) Void -> Fold' b e ()
- withFallibleConsumer :: Consumer b (ExceptT e IO) Void -> Fold' b e ()
- withParser :: Parser b IO (Either e a) -> Fold' b e a
- withParserM :: MonadIO m => (forall r. m (a, r) -> IO (Either e (c, r))) -> Parser b m a -> Fold' b e c
- foldFallibly :: Fold' b e a -> Producer b IO r -> IO (Either e (a, r))
- fold :: Fold' b Void a -> Producer b IO r -> IO (a, r)
- data Transducer' x b e a
- mapper :: (a -> b) -> Transducer' Continuous a e b
- fallibleM :: (a -> Either e b) -> Transducer' Continuous a e b
- fallibleMapper :: (a -> Either e b) -> Transducer' Continuous a e b
- mapperFoldable :: Foldable f => (a -> f b) -> Transducer' Continuous a e b
- mapperEnumerable :: Enumerable f => (a -> f IO b) -> Transducer' Continuous a e b
- transducer :: (forall r. Producer b IO r -> Producer a IO r) -> Transducer' Continuous b e a
- fallibleTransducer :: (forall r. Producer b IO r -> Producer a IO (Either e r)) -> Transducer' Continuous b e a
- delimit :: (forall r. Producer a IO r -> FreeT (Producer a' IO) IO r) -> Transducer' Continuous b e a -> Transducer' Delimited b e a'
- transduce :: Transducer' x b e a -> Fold' a e r -> Fold' b e r
- groups :: (forall r. Producer b IO r -> Producer b' IO r) -> Transducer' Delimited a e b -> Transducer' Delimited a e b'
- folds :: Fold' b Void b' -> Transducer' Delimited a e b -> Transducer' Continuous a e b'
- data Delimited
- data Continuous
Documentation
A computation in IO
that completely drains a Producer
of b
values,
returning a value of type a
, except when it fails early with an error of
type e
.
Bifunctor (Fold' b) Source |
|
Functor (Fold' b e) Source | |
Applicative (Fold' b e) Source |
|
Monoid a => Monoid (Fold' b e a) Source |
withFoldIO :: FoldM IO b a -> Fold' b e a Source
withFallibleFold :: FoldM (ExceptT e IO) b a -> Fold' b e a Source
withConsumer :: Consumer b IO () -> Fold' b e () Source
withConsumer' :: Consumer b IO Void -> Fold' b e () Source
Builds a Fold'
out of a Consumer
that never stops by itself.
fold :: Fold' b Void a -> Producer b IO r -> IO (a, r) Source
Run a Fold'
that never returns an error value (but which may still throw exceptions!)
data Transducer' x b e a Source
A transformation that takes the inputs of a Fold'
from type a
to type b
.
Optionally, the transformation may delimit groups of elements in the
stream. In that case the phantom type x
will be Delimited
. Otherwise, it will be
Continuous
.
M (b -> a) | |
F (b -> [a]) | |
P (forall r. Producer b IO r -> Producer a IO r) | |
PE (forall r. Producer b IO r -> Producer a IO (Either e r)) | |
S (forall r. Producer b IO r -> FreeT (Producer a IO) IO r) | |
SE (forall r. Producer b IO r -> FreeT (Producer a IO) IO (Either e r)) |
Bifunctor (Transducer' x b) Source | |
Functor (Transducer' x b e) Source |
:: (a -> b) | |
-> Transducer' Continuous a e b |
:: (a -> Either e b) | |
-> Transducer' Continuous a e b |
:: (a -> Either e b) | |
-> Transducer' Continuous a e b |
:: Foldable f | |
=> (a -> f b) | |
-> Transducer' Continuous a e b |
:: Enumerable f | |
=> (a -> f IO b) | |
-> Transducer' Continuous a e b |
:: (forall r. Producer b IO r -> Producer a IO r) | |
-> Transducer' Continuous b e a |
:: (forall r. Producer b IO r -> Producer a IO (Either e r)) | |
-> Transducer' Continuous b e a |
:: (forall r. Producer a IO r -> FreeT (Producer a' IO) IO r) | |
-> Transducer' Continuous b e a | |
-> Transducer' Delimited b e a' |
Plug splitting functions from pipes-group
here.
transduce :: Transducer' x b e a -> Fold' a e r -> Fold' b e r Source
Apply a Transducer'
(Delimited
of Continuous
) to a Fold'
.
:: (forall r. Producer b IO r -> Producer b' IO r) | |
-> Transducer' Delimited a e b | |
-> Transducer' Delimited a e b' |
Tweak each of the groups delimited by a Transducer'
.
:: Fold' b Void b' | |
-> Transducer' Delimited a e b | |
-> Transducer' Continuous a e b' |
data Continuous Source