conduit package:conduit
Streaming data processing library.
conduit is a solution to the streaming data problem, allowing
for production, transformation, and consumption of streams of data in
constant memory. It is an alternative to lazy I/O which guarantees
deterministic resource handling.
For more information about conduit in general, and how this package in
particular fits into the ecosystem, see
the conduit homepage.
Hackage documentation generation is not reliable. For up to date
documentation, please see:
http://www.stackage.org/package/conduit.
Your intended one-stop-shop for conduit functionality. This re-exports
functions from many commonly used modules. When there is a conflict
with standard functions, functions in this module are disambiguated by
adding a trailing C (or for chunked functions, replacing a trailing E
with CE). This means that the Conduit module can be imported
unqualified without causing naming conflicts.
For more information on the naming scheme and intended usages of the
combinators, please see the
Data.Conduit.Combinators
documentation.
Deprecated: Use ConduitT directly
Break up a stream of values into vectors of size n. The final vector
may be smaller than n if the total number of values is not a strict
multiple of n. No empty vectors will be yielded.
Core datatype of the conduit package. This type represents a general
component which can consume a stream of input values i,
produce a stream of output values o, perform actions in the
m monad, and produce a final result r. The type
synonyms provided here are simply wrappers around this type.
Since 1.3.0
Core datatype of the conduit package. This type represents a general
component which can consume a stream of input values i,
produce a stream of output values o, perform actions in the
m monad, and produce a final result r. The type
synonyms provided here are simply wrappers around this type.
Since 1.3.0
In order to provide for efficient monadic composition, the
ConduitT type is implemented internally using a technique
known as the codensity transform. This allows for cheap appending, but
makes one case much more expensive: partially running a
ConduitT and that capturing the new state.
This data type is the same as ConduitT, but does not use the
codensity transform technique.
Provides an alternative
Applicative instance for
ConduitT. In this instance, every incoming value is provided
to all
ConduitTs, and output is coalesced together. Leftovers
from individual
ConduitTs will be used within that component,
and then discarded at the end of their computation. Output and
finalizers will both be handled in a left-biased manner.
As an example, take the following program:
main :: IO ()
main = do
let src = mapM_ yield [1..3 :: Int]
conduit1 = CL.map (+1)
conduit2 = CL.concatMap (replicate 2)
conduit = getZipConduit $ ZipConduit conduit1 <* ZipConduit conduit2
sink = CL.mapM_ print
src $$ conduit =$ sink
It will produce the output: 2, 1, 1, 3, 2, 2, 4, 3, 3
Since 1.0.17
Run a pipeline until processing completes.
Since 1.2.1
Run a pure pipeline until processing completes, i.e. a pipeline with
Identity as the base monad. This is equivalient to
runIdentity . runConduit.
Run a pipeline which acquires resources with ResourceT, and
then run the ResourceT transformer. This is equivalent to
runResourceT . runConduit.
Provide identical input to all of the Conduits and combine
their outputs into a single stream.
Implemented on top of ZipConduit, see that data type for more
details.
Since 1.0.17
In order to provide for efficient monadic composition, the
ConduitT type is implemented internally using a technique
known as the codensity transform. This allows for cheap appending, but
makes one case much more expensive: partially running a
ConduitT and that capturing the new state.
This data type is the same as ConduitT, but does not use the
codensity transform technique.
Connect a
Conduit to a sink and return the output of the sink
together with a new
Conduit.
Since 1.0.17