Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Conduit input output monad result
- data ResourceT m a
-
newtype
ZipSink
i m r =
ZipSink
{
- getZipSink :: Conduit i () m r
- await :: Conduit i o m ( Maybe i)
- awaitForever :: (input -> Conduit input output monad b) -> Conduit input output monad ()
- yield :: Monad m => o -> Conduit i o m ()
- yields :: ( Monad m, Foldable os, Element os ~ o) => os -> Conduit i o m ()
- yieldOr :: o -> m () -> Conduit i o m ()
- leftover :: i -> Conduit i o m ()
- runConduit :: Monad m => Conduit () () m r -> m r
- runConduitPure :: Conduit () () Identity r -> r
- runConduitRes :: ( MonadBracket m, MonadIO m) => Conduit () () ( ResourceT m) r -> m r
- fuse :: Monad m => Conduit a b m () -> Conduit b c m r -> Conduit a c m r
- (.|) :: Monad m => Conduit a b m () -> Conduit b c m r -> Conduit a c m r
- sourceFile :: MonadResource m => FilePath -> Conduit i ( UArray Word8 ) m ()
- sourceHandle :: MonadIO m => Handle -> Conduit i ( UArray Word8 ) m ()
- sinkFile :: MonadResource m => FilePath -> Conduit ( UArray Word8 ) i m ()
- sinkHandle :: MonadIO m => Handle -> Conduit ( UArray Word8 ) o m ()
- sinkList :: Monad m => Conduit i o m [i]
- bracketConduit :: MonadResource m => IO a -> (a -> IO b) -> (a -> Conduit i o m r) -> Conduit i o m r
Documentation
data Conduit input output monad result Source #
A component of a conduit pipeline, which takes a stream of
input
, produces a stream of
output
, performs actions in the
underlying
monad
, and produces a value of
result
when no more
output data is available.
Instances
MonadTrans ( Conduit i o) Source # | |
Monad ( Conduit i o m) Source # | |
Functor ( Conduit i o m) Source # | |
Applicative ( Conduit i o m) Source # | |
Defined in Foundation.Conduit.Internal pure :: a -> Conduit i o m a Source # (<*>) :: Conduit i o m (a -> b) -> Conduit i o m a -> Conduit i o m b Source # liftA2 :: (a -> b -> c) -> Conduit i o m a -> Conduit i o m b -> Conduit i o m c Source # (*>) :: Conduit i o m a -> Conduit i o m b -> Conduit i o m b Source # (<*) :: Conduit i o m a -> Conduit i o m b -> Conduit i o m a Source # |
|
MonadIO m => MonadIO ( Conduit i o m) Source # | |
MonadFailure m => MonadFailure ( Conduit i o m) Source # | |
MonadCatch m => MonadCatch ( Conduit i o m) Source # | |
MonadThrow m => MonadThrow ( Conduit i o m) Source # | |
type Failure ( Conduit i o m) Source # | |
Defined in Foundation.Conduit.Internal |
Instances
MonadTrans ResourceT Source # | |
Monad m => Monad ( ResourceT m) Source # | |
Functor m => Functor ( ResourceT m) Source # | |
Applicative m => Applicative ( ResourceT m) Source # | |
Defined in Foundation.Conduit.Internal pure :: a -> ResourceT m a Source # (<*>) :: ResourceT m (a -> b) -> ResourceT m a -> ResourceT m b Source # liftA2 :: (a -> b -> c) -> ResourceT m a -> ResourceT m b -> ResourceT m c Source # (*>) :: ResourceT m a -> ResourceT m b -> ResourceT m b Source # (<*) :: ResourceT m a -> ResourceT m b -> ResourceT m a Source # |
|
MonadIO m => MonadIO ( ResourceT m) Source # | |
MonadBracket m => MonadBracket ( ResourceT m) Source # | |
Defined in Foundation.Conduit.Internal generalBracket :: ResourceT m a -> (a -> b -> ResourceT m ignored1) -> (a -> SomeException -> ResourceT m ignored2) -> (a -> ResourceT m b) -> ResourceT m b Source # |
|
MonadCatch m => MonadCatch ( ResourceT m) Source # | |
MonadThrow m => MonadThrow ( ResourceT m) Source # | |
newtype ZipSink i m r Source #
ZipSink | |
|
Instances
Monad m => Functor ( ZipSink i m) Source # | |
Monad m => Applicative ( ZipSink i m) Source # | |
Defined in Foundation.Conduit.Internal pure :: a -> ZipSink i m a Source # (<*>) :: ZipSink i m (a -> b) -> ZipSink i m a -> ZipSink i m b Source # liftA2 :: (a -> b -> c) -> ZipSink i m a -> ZipSink i m b -> ZipSink i m c Source # (*>) :: ZipSink i m a -> ZipSink i m b -> ZipSink i m b Source # (<*) :: ZipSink i m a -> ZipSink i m b -> ZipSink i m a Source # |
awaitForever :: (input -> Conduit input output monad b) -> Conduit input output monad () Source #
yields :: ( Monad m, Foldable os, Element os ~ o) => os -> Conduit i o m () Source #
Send values downstream.
:: o | |
-> m () |
finalizer |
-> Conduit i o m () |
Same as
yield
, but additionally takes a finalizer to be run if
the downstream component terminates.
leftover :: i -> Conduit i o m () Source #
Provide leftover input to be consumed by the next component in the current monadic binding.
runConduit :: Monad m => Conduit () () m r -> m r Source #
Run a conduit pipeline to completion.
runConduitPure :: Conduit () () Identity r -> r Source #
Run a pure conduit pipeline to completion.
runConduitRes :: ( MonadBracket m, MonadIO m) => Conduit () () ( ResourceT m) r -> m r Source #
Run a conduit pipeline in a
ResourceT
context for acquiring resources.
fuse :: Monad m => Conduit a b m () -> Conduit b c m r -> Conduit a c m r Source #
Send the output of the first Conduit component to the second Conduit component.