    {-# OPTIONS_HADDOCK not-home #-}
    {-# LANGUAGE DeriveFunctor #-}
    {-# LANGUAGE FlexibleInstances #-}
    {-# LANGUAGE FlexibleContexts #-}
    {-# LANGUAGE CPP #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE UndecidableInstances #-}
    {-# LANGUAGE RankNTypes #-}
    {-# LANGUAGE TupleSections #-}
    {-# LANGUAGE Trustworthy #-}
    {-# LANGUAGE TypeFamilies #-}
    module Data.Conduit.Internal.Conduit
        ( -- ** Types
          ConduitT (..)
        , ConduitM
        , Source
        , Producer
        , Sink
        , Consumer
        , Conduit
        , Flush (..)
          -- *** Newtype wrappers
        , ZipSource (..)
        , ZipSink (..)
        , ZipConduit (..)
          -- ** Sealed
        , SealedConduitT (..)
        , sealConduitT
        , unsealConduitT
          -- ** Primitives
        , await
        , awaitForever
        , yield
        , yieldM
        , leftover
        , runConduit
        , runConduitPure
        , runConduitRes
        , fuse
        , connect
          -- ** Composition
        , connectResume
        , connectResumeConduit
        , fuseLeftovers
        , fuseReturnLeftovers
        , ($$+)
        , ($$++)
        , ($$+-)
        , ($=+)
        , (=$$+)
        , (=$$++)
        , (=$$+-)
        , ($$)
        , ($=)
        , (=$)
        , (=$=)
        , (.|)
          -- ** Generalizing
        , sourceToPipe
        , sinkToPipe
        , conduitToPipe
        , toProducer
        , toConsumer
          -- ** Cleanup
        , bracketP
          -- ** Exceptions
        , catchC
        , handleC
        , tryC
          -- ** Utilities
        , Data.Conduit.Internal.Conduit.transPipe
        , Data.Conduit.Internal.Conduit.mapOutput
        , Data.Conduit.Internal.Conduit.mapOutputMaybe
        , Data.Conduit.Internal.Conduit.mapInput
        , Data.Conduit.Internal.Conduit.mapInputM
        , zipSinks
        , zipSources
        , zipSourcesApp
        , zipConduitApp
        , mergeSource
        , passthroughSink
        , sourceToList
        , fuseBoth
        , fuseBothMaybe
        , fuseUpstream
        , sequenceSources
        , sequenceSinks
        , sequenceConduits
        ) where

    import Control.Applicative (Applicative (..))
    import Control.Exception (Exception)
    import qualified Control.Exception as E (catch)
    import Control.Monad (liftM, liftM2, ap)
    import Control.Monad.Fail(MonadFail(..))
    import Control.Monad.Error.Class(MonadError(..))
    import Control.Monad.Reader.Class(MonadReader(..))
    import Control.Monad.RWS.Class(MonadRWS())
    import Control.Monad.Writer.Class(MonadWriter(..), censor)
    import Control.Monad.State.Class(MonadState(..))
    import Control.Monad.Trans.Class (MonadTrans (lift))
    import Control.Monad.IO.Unlift (MonadIO (liftIO), MonadUnliftIO, withRunInIO)
    import Control.Monad.Primitive (PrimMonad, PrimState, primitive)
    import Data.Functor.Identity (Identity, runIdentity)
    import Data.Void (Void, absurd)
    import Data.Monoid (Monoid (mappend, mempty))
    import Data.Semigroup (Semigroup ((<>)))
    import Control.Monad.Trans.Resource
    import Data.Conduit.Internal.Pipe hiding (yield, mapOutput, leftover, yieldM, await, awaitForever, bracketP)
    import qualified Data.Conduit.Internal.Pipe as CI
    import Control.Monad (forever)
    import Data.Traversable (Traversable (..))

    -- | 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
    newtype ConduitT i o m r = ConduitT
        { ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT :: forall b.
                        (r -> Pipe i i o () m b) -> Pipe i i o () m b
        }

    -- | 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.
    --
    -- @since 1.3.0
    newtype SealedConduitT i o m r = SealedConduitT (Pipe i i o () m r)

    -- | Same as 'ConduitT', for backwards compat
    type ConduitM = ConduitT

    instance Functor (ConduitT i o m) where
        fmap :: (a -> b) -> ConduitT i o m a -> ConduitT i o m b
    fmap f :: a -> b
    f (ConduitT c :: forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c) = (forall b. (b -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m b
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (b -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m b)
    -> (forall b. (b -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m b
    forall a b. (a -> b) -> a -> b
    $ \rest :: b -> Pipe i i o () m b
    rest -> (a -> Pipe i i o () m b) -> Pipe i i o () m b
    forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c (b -> Pipe i i o () m b
    rest (b -> Pipe i i o () m b) -> (a -> b) -> a -> Pipe i i o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> b
    f)

    instance Applicative (ConduitT i o m) where
        pure :: a -> ConduitT i o m a
    pure x :: a
    x = (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((a -> Pipe i i o () m b) -> a -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ a
    x)
        {-# INLINE pure #-}
        <*> :: ConduitT i o m (a -> b) -> ConduitT i o m a -> ConduitT i o m b
    (<*>) = ConduitT i o m (a -> b) -> ConduitT i o m a -> ConduitT i o m b
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    ap
        {-# INLINE (<*>) #-}

    instance Monad (ConduitT i o m) where
        return :: a -> ConduitT i o m a
    return = a -> ConduitT i o m a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure
        ConduitT f :: forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    f >>= :: ConduitT i o m a -> (a -> ConduitT i o m b) -> ConduitT i o m b
    >>= g :: a -> ConduitT i o m b
    g = (forall b. (b -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m b
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (b -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m b)
    -> (forall b. (b -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m b
    forall a b. (a -> b) -> a -> b
    $ \h :: b -> Pipe i i o () m b
    h -> (a -> Pipe i i o () m b) -> Pipe i i o () m b
    forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    f ((a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> (a -> Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ \a :: a
    a -> ConduitT i o m b -> (b -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT (a -> ConduitT i o m b
    g a
    a) b -> Pipe i i o () m b
    h

    -- | @since 1.3.1
    instance MonadFail m => MonadFail (ConduitT i o m) where
        fail :: String -> ConduitT i o m a
    fail = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a)
    -> (String -> m a) -> String -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> m a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    Control.Monad.Fail.fail

    instance MonadThrow m => MonadThrow (ConduitT i o m) where
        throwM :: e -> ConduitT i o m a
    throwM = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a) -> (e -> m a) -> e -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . e -> m a
    forall (m :: * -> *) e a. (MonadThrow m, Exception e) => e -> m a
    throwM

    instance MonadIO m => MonadIO (ConduitT i o m) where
        liftIO :: IO a -> ConduitT i o m a
    liftIO = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a)
    -> (IO a -> m a) -> IO a -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO
        {-# INLINE liftIO #-}

    instance MonadReader r m => MonadReader r (ConduitT i o m) where
        ask :: ConduitT i o m r
    ask = m r -> ConduitT i o m r
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift m r
    forall r (m :: * -> *). MonadReader r m => m r
    ask
        {-# INLINE ask #-}

        local :: (r -> r) -> ConduitT i o m a -> ConduitT i o m a
    local f :: r -> r
    f (ConduitT c0 :: forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c0) = (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m a)
    -> (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall a b. (a -> b) -> a -> b
    $ \rest :: a -> Pipe i i o () m b
    rest ->
            let go :: Pipe i i o () m a -> Pipe i i o () m b
    go (HaveOutput p :: Pipe i i o () m a
    p o :: o
    o) = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i i o () m a -> Pipe i i o () m b
    go Pipe i i o () m a
    p) o
    o
                go (NeedInput p :: i -> Pipe i i o () m a
    p c :: () -> Pipe i i o () m a
    c) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> Pipe i i o () m a -> Pipe i i o () m b
    go (i -> Pipe i i o () m a
    p i
    i)) (\u :: ()
    u -> Pipe i i o () m a -> Pipe i i o () m b
    go (() -> Pipe i i o () m a
    c ()
    u))
                go (Done x :: a
    x) = a -> Pipe i i o () m b
    rest a
    x
                go (PipeM mp :: m (Pipe i i o () m a)
    mp) = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe i i o () m a -> Pipe i i o () m b)
    -> m (Pipe i i o () m a) -> m (Pipe i i o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe i i o () m a -> Pipe i i o () m b
    go (m (Pipe i i o () m a) -> m (Pipe i i o () m b))
    -> m (Pipe i i o () m a) -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ (r -> r) -> m (Pipe i i o () m a) -> m (Pipe i i o () m a)
    forall r (m :: * -> *) a. MonadReader r m => (r -> r) -> m a -> m a
    local r -> r
    f m (Pipe i i o () m a)
    mp)
                go (Leftover p :: Pipe i i o () m a
    p i :: i
    i) = Pipe i i o () m b -> i -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o () m a -> Pipe i i o () m b
    go Pipe i i o () m a
    p) i
    i
             in Pipe i i o () m a -> Pipe i i o () m b
    go ((a -> Pipe i i o () m a) -> Pipe i i o () m a
    forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c0 a -> Pipe i i o () m a
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    #ifndef MIN_VERSION_mtl
    #define MIN_VERSION_mtl(x, y, z) 0
    #endif

    instance MonadWriter w m => MonadWriter w (ConduitT i o m) where
    #if MIN_VERSION_mtl(2, 1, 0)
        writer :: (a, w) -> ConduitT i o m a
    writer = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a)
    -> ((a, w) -> m a) -> (a, w) -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (a, w) -> m a
    forall w (m :: * -> *) a. MonadWriter w m => (a, w) -> m a
    writer
    #endif
        tell :: w -> ConduitT i o m ()
    tell = m () -> ConduitT i o m ()
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m () -> ConduitT i o m ())
    -> (w -> m ()) -> w -> ConduitT i o m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . w -> m ()
    forall w (m :: * -> *). MonadWriter w m => w -> m ()
    tell

        listen :: ConduitT i o m a -> ConduitT i o m (a, w)
    listen (ConduitT c0 :: forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c0) = (forall b. ((a, w) -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m (a, w)
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. ((a, w) -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m (a, w))
    -> (forall b. ((a, w) -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m (a, w)
    forall a b. (a -> b) -> a -> b
    $ \rest :: (a, w) -> Pipe i i o () m b
    rest ->
            let go :: w -> Pipe i i o () m a -> Pipe i i o () m b
    go front :: w
    front (HaveOutput p :: Pipe i i o () m a
    p o :: o
    o) = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (w -> Pipe i i o () m a -> Pipe i i o () m b
    go w
    front Pipe i i o () m a
    p) o
    o
                go front :: w
    front (NeedInput p :: i -> Pipe i i o () m a
    p c :: () -> Pipe i i o () m a
    c) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> w -> Pipe i i o () m a -> Pipe i i o () m b
    go w
    front (i -> Pipe i i o () m a
    p i
    i)) (\u :: ()
    u -> w -> Pipe i i o () m a -> Pipe i i o () m b
    go w
    front (() -> Pipe i i o () m a
    c ()
    u))
                go front :: w
    front (Done x :: a
    x) = (a, w) -> Pipe i i o () m b
    rest (a
    x, w
    front)
                go front :: w
    front (PipeM mp :: m (Pipe i i o () m a)
    mp) = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i i o () m b) -> Pipe i i o () m b)
    -> m (Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ do
                    (p :: Pipe i i o () m a
    p,w :: w
    w) <- m (Pipe i i o () m a) -> m (Pipe i i o () m a, w)
    forall w (m :: * -> *) a. MonadWriter w m => m a -> m (a, w)
    listen m (Pipe i i o () m a)
    mp
                    Pipe i i o () m b -> m (Pipe i i o () m b)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pipe i i o () m b -> m (Pipe i i o () m b))
    -> Pipe i i o () m b -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ w -> Pipe i i o () m a -> Pipe i i o () m b
    go (w
    front w -> w -> w
    forall a. Monoid a => a -> a -> a
    `mappend` w
    w) Pipe i i o () m a
    p
                go front :: w
    front (Leftover p :: Pipe i i o () m a
    p i :: i
    i) = Pipe i i o () m b -> i -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (w -> Pipe i i o () m a -> Pipe i i o () m b
    go w
    front Pipe i i o () m a
    p) i
    i
             in w -> Pipe i i o () m a -> Pipe i i o () m b
    go w
    forall a. Monoid a => a
    mempty ((a -> Pipe i i o () m a) -> Pipe i i o () m a
    forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c0 a -> Pipe i i o () m a
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

        pass :: ConduitT i o m (a, w -> w) -> ConduitT i o m a
    pass (ConduitT c0 :: forall b. ((a, w -> w) -> Pipe i i o () m b) -> Pipe i i o () m b
    c0) = (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m a)
    -> (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall a b. (a -> b) -> a -> b
    $ \rest :: a -> Pipe i i o () m b
    rest ->
            let go :: w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go front :: w
    front (HaveOutput p :: Pipe i i o () m (a, w -> w)
    p o :: o
    o) = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go w
    front Pipe i i o () m (a, w -> w)
    p) o
    o
                go front :: w
    front (NeedInput p :: i -> Pipe i i o () m (a, w -> w)
    p c :: () -> Pipe i i o () m (a, w -> w)
    c) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go w
    front (i -> Pipe i i o () m (a, w -> w)
    p i
    i)) (\u :: ()
    u -> w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go w
    front (() -> Pipe i i o () m (a, w -> w)
    c ()
    u))
                go front :: w
    front (PipeM mp :: m (Pipe i i o () m (a, w -> w))
    mp) = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i i o () m b) -> Pipe i i o () m b)
    -> m (Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ do
                    (p :: Pipe i i o () m (a, w -> w)
    p,w :: w
    w) <- (w -> w)
    -> m (Pipe i i o () m (a, w -> w), w)
    -> m (Pipe i i o () m (a, w -> w), w)
    forall w (m :: * -> *) a. MonadWriter w m => (w -> w) -> m a -> m a
    censor (w -> w -> w
    forall a b. a -> b -> a
    const w
    forall a. Monoid a => a
    mempty) (m (Pipe i i o () m (a, w -> w))
    -> m (Pipe i i o () m (a, w -> w), w)
    forall w (m :: * -> *) a. MonadWriter w m => m a -> m (a, w)
    listen m (Pipe i i o () m (a, w -> w))
    mp)
                    Pipe i i o () m b -> m (Pipe i i o () m b)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pipe i i o () m b -> m (Pipe i i o () m b))
    -> Pipe i i o () m b -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go (w
    front w -> w -> w
    forall a. Monoid a => a -> a -> a
    `mappend` w
    w) Pipe i i o () m (a, w -> w)
    p
                go front :: w
    front (Done (x :: a
    x,f :: w -> w
    f)) = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i i o () m b) -> Pipe i i o () m b)
    -> m (Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ do
                    w -> m ()
    forall w (m :: * -> *). MonadWriter w m => w -> m ()
    tell (w -> w
    f w
    front)
                    Pipe i i o () m b -> m (Pipe i i o () m b)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pipe i i o () m b -> m (Pipe i i o () m b))
    -> Pipe i i o () m b -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ a -> Pipe i i o () m b
    rest a
    x
                go front :: w
    front (Leftover p :: Pipe i i o () m (a, w -> w)
    p i :: i
    i) = Pipe i i o () m b -> i -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go w
    front Pipe i i o () m (a, w -> w)
    p) i
    i
             in w -> Pipe i i o () m (a, w -> w) -> Pipe i i o () m b
    go w
    forall a. Monoid a => a
    mempty (((a, w -> w) -> Pipe i i o () m (a, w -> w))
    -> Pipe i i o () m (a, w -> w)
    forall b. ((a, w -> w) -> Pipe i i o () m b) -> Pipe i i o () m b
    c0 (a, w -> w) -> Pipe i i o () m (a, w -> w)
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    instance MonadState s m => MonadState s (ConduitT i o m) where
        get :: ConduitT i o m s
    get = m s -> ConduitT i o m s
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift m s
    forall s (m :: * -> *). MonadState s m => m s
    get
        put :: s -> ConduitT i o m ()
    put = m () -> ConduitT i o m ()
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m () -> ConduitT i o m ())
    -> (s -> m ()) -> s -> ConduitT i o m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . s -> m ()
    forall s (m :: * -> *). MonadState s m => s -> m ()
    put
    #if MIN_VERSION_mtl(2, 1, 0)
        state :: (s -> (a, s)) -> ConduitT i o m a
    state = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a)
    -> ((s -> (a, s)) -> m a) -> (s -> (a, s)) -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (s -> (a, s)) -> m a
    forall s (m :: * -> *) a. MonadState s m => (s -> (a, s)) -> m a
    state
    #endif

    instance MonadRWS r w s m => MonadRWS r w s (ConduitT i o m)

    instance MonadError e m => MonadError e (ConduitT i o m) where
        throwError :: e -> ConduitT i o m a
    throwError = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a) -> (e -> m a) -> e -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . e -> m a
    forall e (m :: * -> *) a. MonadError e m => e -> m a
    throwError
        catchError :: ConduitT i o m a -> (e -> ConduitT i o m a) -> ConduitT i o m a
    catchError (ConduitT c0 :: forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c0) f :: e -> ConduitT i o m a
    f = (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m a)
    -> (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall a b. (a -> b) -> a -> b
    $ \rest :: a -> Pipe i i o () m b
    rest ->
            let go :: Pipe i i o () m a -> Pipe i i o () m b
    go (HaveOutput p :: Pipe i i o () m a
    p o :: o
    o) = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i i o () m a -> Pipe i i o () m b
    go Pipe i i o () m a
    p) o
    o
                go (NeedInput p :: i -> Pipe i i o () m a
    p c :: () -> Pipe i i o () m a
    c) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> Pipe i i o () m a -> Pipe i i o () m b
    go (i -> Pipe i i o () m a
    p i
    i)) (\u :: ()
    u -> Pipe i i o () m a -> Pipe i i o () m b
    go (() -> Pipe i i o () m a
    c ()
    u))
                go (Done x :: a
    x) = a -> Pipe i i o () m b
    rest a
    x
                go (PipeM mp :: m (Pipe i i o () m a)
    mp) =
                  m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i i o () m b) -> Pipe i i o () m b)
    -> m (Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ m (Pipe i i o () m b)
    -> (e -> m (Pipe i i o () m b)) -> m (Pipe i i o () m b)
    forall e (m :: * -> *) a.
    MonadError e m =>
    m a -> (e -> m a) -> m a
    catchError ((Pipe i i o () m a -> Pipe i i o () m b)
    -> m (Pipe i i o () m a) -> m (Pipe i i o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe i i o () m a -> Pipe i i o () m b
    go m (Pipe i i o () m a)
    mp) ((e -> m (Pipe i i o () m b)) -> m (Pipe i i o () m b))
    -> (e -> m (Pipe i i o () m b)) -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ \e :: e
    e -> do
                    Pipe i i o () m b -> m (Pipe i i o () m b)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pipe i i o () m b -> m (Pipe i i o () m b))
    -> Pipe i i o () m b -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ ConduitT i o m a -> (a -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT (e -> ConduitT i o m a
    f e
    e) a -> Pipe i i o () m b
    rest
                go (Leftover p :: Pipe i i o () m a
    p i :: i
    i) = Pipe i i o () m b -> i -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o () m a -> Pipe i i o () m b
    go Pipe i i o () m a
    p) i
    i
             in Pipe i i o () m a -> Pipe i i o () m b
    go ((a -> Pipe i i o () m a) -> Pipe i i o () m a
    forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b
    c0 a -> Pipe i i o () m a
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    instance MonadTrans (ConduitT i o) where
        lift :: m a -> ConduitT i o m a
    lift mr :: m a
    mr = (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m a)
    -> (forall b. (a -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m a
    forall a b. (a -> b) -> a -> b
    $ \rest :: a -> Pipe i i o () m b
    rest -> m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((a -> Pipe i i o () m b) -> m a -> m (Pipe i i o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM a -> Pipe i i o () m b
    rest m a
    mr)
        {-# INLINE [1] lift #-}

    instance MonadResource m => MonadResource (ConduitT i o m) where
        liftResourceT :: ResourceT IO a -> ConduitT i o m a
    liftResourceT = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a)
    -> (ResourceT IO a -> m a) -> ResourceT IO a -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ResourceT IO a -> m a
    forall (m :: * -> *) a. MonadResource m => ResourceT IO a -> m a
    liftResourceT
        {-# INLINE liftResourceT #-}

    instance Monad m => Semigroup (ConduitT i o m ()) where
        <> :: ConduitT i o m () -> ConduitT i o m () -> ConduitT i o m ()
    (<>) = ConduitT i o m () -> ConduitT i o m () -> ConduitT i o m ()
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    (>>)
        {-# INLINE (<>) #-}

    instance Monad m => Monoid (ConduitT i o m ()) where
        mempty :: ConduitT i o m ()
    mempty = () -> ConduitT i o m ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()
        {-# INLINE mempty #-}
    #if !(MIN_VERSION_base(4,11,0))
        mappend = (<>)
        {-# INLINE mappend #-}
    #endif

    instance PrimMonad m => PrimMonad (ConduitT i o m) where
      type PrimState (ConduitT i o m) = PrimState m
      primitive :: (State# (PrimState (ConduitT i o m))
     -> (# State# (PrimState (ConduitT i o m)), a #))
    -> ConduitT i o m a
    primitive = m a -> ConduitT i o m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ConduitT i o m a)
    -> ((State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a)
    -> (State# (PrimState m) -> (# State# (PrimState m), a #))
    -> ConduitT i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
    forall (m :: * -> *) a.
    PrimMonad m =>
    (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
    primitive

    -- | Provides a stream of output values, without consuming any input or
    -- producing a final result.
    --
    -- Since 0.5.0
    type Source m o = ConduitT () o m ()
    {-# DEPRECATED Source "Use ConduitT directly" #-}

    -- | A component which produces a stream of output values, regardless of the
    -- input stream. A @Producer@ is a generalization of a @Source@, and can be
    -- used as either a @Source@ or a @Conduit@.
    --
    -- Since 1.0.0
    type Producer m o = forall i. ConduitT i o m ()
    {-# DEPRECATED Producer "Use ConduitT directly" #-}

    -- | Consumes a stream of input values and produces a final result, without
    -- producing any output.
    --
    -- > type Sink i m r = ConduitT i Void m r
    --
    -- Since 0.5.0
    type Sink i = ConduitT i Void
    {-# DEPRECATED Sink "Use ConduitT directly" #-}

    -- | A component which consumes a stream of input values and produces a final
    -- result, regardless of the output stream. A @Consumer@ is a generalization of
    -- a @Sink@, and can be used as either a @Sink@ or a @Conduit@.
    --
    -- Since 1.0.0
    type Consumer i m r = forall o. ConduitT i o m r
    {-# DEPRECATED Consumer "Use ConduitT directly" #-}

    -- | Consumes a stream of input values and produces a stream of output values,
    -- without producing a final result.
    --
    -- Since 0.5.0
    type Conduit i m o = ConduitT i o m ()
    {-# DEPRECATED Conduit "Use ConduitT directly" #-}

    sealConduitT :: ConduitT i o m r -> SealedConduitT i o m r
    sealConduitT :: ConduitT i o m r -> SealedConduitT i o m r
    sealConduitT (ConduitT f :: forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    f) = Pipe i i o () m r -> SealedConduitT i o m r
    forall i o (m :: * -> *) r.
    Pipe i i o () m r -> SealedConduitT i o m r
    SealedConduitT ((r -> Pipe i i o () m r) -> Pipe i i o () m r
    forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    f r -> Pipe i i o () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    unsealConduitT :: Monad m => SealedConduitT i o m r -> ConduitT i o m r
    unsealConduitT :: SealedConduitT i o m r -> ConduitT i o m r
    unsealConduitT (SealedConduitT f :: Pipe i i o () m r
    f) = (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT (Pipe i i o () m r
    f Pipe i i o () m r -> (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>=)

    -- | Connect a @Source@ to a @Sink@ until the latter closes. Returns both the
    -- most recent state of the @Source@ and the result of the @Sink@.
    --
    -- Since 0.5.0
    connectResume :: Monad m
                  => SealedConduitT () a m ()
                  -> ConduitT a Void m r
                  -> m (SealedConduitT () a m (), r)
    connectResume :: SealedConduitT () a m ()
    -> ConduitT a Void m r -> m (SealedConduitT () a m (), r)
    connectResume (SealedConduitT left0 :: Pipe () () a () m ()
    left0) (ConduitT right0 :: forall b. (r -> Pipe a a Void () m b) -> Pipe a a Void () m b
    right0) =
        Pipe () () a () m ()
    -> Pipe a a Void () m r -> m (SealedConduitT () a m (), r)
    forall (m :: * -> *) i b.
    Monad m =>
    Pipe () () i () m ()
    -> Pipe i i Void () m b -> m (SealedConduitT () i m (), b)
    goRight Pipe () () a () m ()
    left0 ((r -> Pipe a a Void () m r) -> Pipe a a Void () m r
    forall b. (r -> Pipe a a Void () m b) -> Pipe a a Void () m b
    right0 r -> Pipe a a Void () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)
      where
        goRight :: Pipe () () i () m ()
    -> Pipe i i Void () m b -> m (SealedConduitT () i m (), b)
    goRight left :: Pipe () () i () m ()
    left right :: Pipe i i Void () m b
    right =
            case Pipe i i Void () m b
    right of
                HaveOutput _ o :: Void
    o   -> Void -> m (SealedConduitT () i m (), b)
    forall a. Void -> a
    absurd Void
    o
                NeedInput rp :: i -> Pipe i i Void () m b
    rp rc :: () -> Pipe i i Void () m b
    rc  -> (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b)
    -> Pipe () () i () m ()
    -> m (SealedConduitT () i m (), b)
    goLeft i -> Pipe i i Void () m b
    rp () -> Pipe i i Void () m b
    rc Pipe () () i () m ()
    left
                Done r2 :: b
    r2          -> (SealedConduitT () i m (), b) -> m (SealedConduitT () i m (), b)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pipe () () i () m () -> SealedConduitT () i m ()
    forall i o (m :: * -> *) r.
    Pipe i i o () m r -> SealedConduitT i o m r
    SealedConduitT Pipe () () i () m ()
    left, b
    r2)
                PipeM mp :: m (Pipe i i Void () m b)
    mp         -> m (Pipe i i Void () m b)
    mp m (Pipe i i Void () m b)
    -> (Pipe i i Void () m b -> m (SealedConduitT () i m (), b))
    -> m (SealedConduitT () i m (), b)
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Pipe () () i () m ()
    -> Pipe i i Void () m b -> m (SealedConduitT () i m (), b)
    goRight Pipe () () i () m ()
    left
                Leftover p :: Pipe i i Void () m b
    p i :: i
    i     -> Pipe () () i () m ()
    -> Pipe i i Void () m b -> m (SealedConduitT () i m (), b)
    goRight (Pipe () () i () m () -> i -> Pipe () () i () m ()
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput Pipe () () i () m ()
    left i
    i) Pipe i i Void () m b
    p

        goLeft :: (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b)
    -> Pipe () () i () m ()
    -> m (SealedConduitT () i m (), b)
    goLeft rp :: i -> Pipe i i Void () m b
    rp rc :: () -> Pipe i i Void () m b
    rc left :: Pipe () () i () m ()
    left =
            case Pipe () () i () m ()
    left of
                HaveOutput left' :: Pipe () () i () m ()
    left' o :: i
    o            -> Pipe () () i () m ()
    -> Pipe i i Void () m b -> m (SealedConduitT () i m (), b)
    goRight Pipe () () i () m ()
    left' (i -> Pipe i i Void () m b
    rp i
    o)
                NeedInput _ lc :: () -> Pipe () () i () m ()
    lc                -> Pipe () () i () m () -> m (SealedConduitT () i m (), b)
    recurse (() -> Pipe () () i () m ()
    lc ())
                Done ()                       -> Pipe () () i () m ()
    -> Pipe i i Void () m b -> m (SealedConduitT () i m (), b)
    goRight (() -> Pipe () () i () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done ()) (() -> Pipe i i Void () m b
    rc ())
                PipeM mp :: m (Pipe () () i () m ())
    mp                      -> m (Pipe () () i () m ())
    mp m (Pipe () () i () m ())
    -> (Pipe () () i () m () -> m (SealedConduitT () i m (), b))
    -> m (SealedConduitT () i m (), b)
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Pipe () () i () m () -> m (SealedConduitT () i m (), b)
    recurse
                Leftover p :: Pipe () () i () m ()
    p ()                 -> Pipe () () i () m () -> m (SealedConduitT () i m (), b)
    recurse Pipe () () i () m ()
    p
          where
            recurse :: Pipe () () i () m () -> m (SealedConduitT () i m (), b)
    recurse = (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b)
    -> Pipe () () i () m ()
    -> m (SealedConduitT () i m (), b)
    goLeft i -> Pipe i i Void () m b
    rp () -> Pipe i i Void () m b
    rc

    sourceToPipe :: Monad m => Source m o -> Pipe l i o u m ()
    sourceToPipe :: Source m o -> Pipe l i o u m ()
    sourceToPipe =
        Pipe () () o () m () -> Pipe l i o u m ()
    forall (m :: * -> *) i o l i u.
    Monad m =>
    Pipe () i o () m () -> Pipe l i o u m ()
    go (Pipe () () o () m () -> Pipe l i o u m ())
    -> (Source m o -> Pipe () () o () m ())
    -> Source m o
    -> Pipe l i o u m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Source m o
     -> (() -> Pipe () () o () m ()) -> Pipe () () o () m ())
    -> (() -> Pipe () () o () m ())
    -> Source m o
    -> Pipe () () o () m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Source m o -> (() -> Pipe () () o () m ()) -> Pipe () () o () m ()
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT () -> Pipe () () o () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done
      where
        go :: Pipe () i o () m () -> Pipe l i o u m ()
    go (HaveOutput p :: Pipe () i o () m ()
    p o :: o
    o) = Pipe l i o u m () -> o -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe () i o () m () -> Pipe l i o u m ()
    go Pipe () i o () m ()
    p) o
    o
        go (NeedInput _ c :: () -> Pipe () i o () m ()
    c) = Pipe () i o () m () -> Pipe l i o u m ()
    go (Pipe () i o () m () -> Pipe l i o u m ())
    -> Pipe () i o () m () -> Pipe l i o u m ()
    forall a b. (a -> b) -> a -> b
    $ () -> Pipe () i o () m ()
    c ()
        go (Done ()) = () -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done ()
        go (PipeM mp :: m (Pipe () i o () m ())
    mp) = m (Pipe l i o u m ()) -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () i o () m () -> Pipe l i o u m ())
    -> m (Pipe () i o () m ()) -> m (Pipe l i o u m ())
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe () i o () m () -> Pipe l i o u m ()
    go m (Pipe () i o () m ())
    mp)
        go (Leftover p :: Pipe () i o () m ()
    p ()) = Pipe () i o () m () -> Pipe l i o u m ()
    go Pipe () i o () m ()
    p

    sinkToPipe :: Monad m => Sink i m r -> Pipe l i o u m r
    sinkToPipe :: Sink i m r -> Pipe l i o u m r
    sinkToPipe =
        Pipe Void i Void () m r -> Pipe l i o u m r
    forall (m :: * -> *) i r l o u.
    Monad m =>
    Pipe Void i Void () m r -> Pipe l i o u m r
    go (Pipe Void i Void () m r -> Pipe l i o u m r)
    -> (Sink i m r -> Pipe Void i Void () m r)
    -> Sink i m r
    -> Pipe l i o u m r
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Pipe i i Void () m r -> Pipe Void i Void () m r
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers (Pipe i i Void () m r -> Pipe Void i Void () m r)
    -> (Sink i m r -> Pipe i i Void () m r)
    -> Sink i m r
    -> Pipe Void i Void () m r
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Sink i m r -> (r -> Pipe i i Void () m r) -> Pipe i i Void () m r)
    -> (r -> Pipe i i Void () m r)
    -> Sink i m r
    -> Pipe i i Void () m r
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Sink i m r -> (r -> Pipe i i Void () m r) -> Pipe i i Void () m r
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT r -> Pipe i i Void () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done
      where
        go :: Pipe Void i Void () m r -> Pipe l i o u m r
    go (HaveOutput _ o :: Void
    o) = Void -> Pipe l i o u m r
    forall a. Void -> a
    absurd Void
    o
        go (NeedInput p :: i -> Pipe Void i Void () m r
    p c :: () -> Pipe Void i Void () m r
    c) = (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe Void i Void () m r -> Pipe l i o u m r
    go (Pipe Void i Void () m r -> Pipe l i o u m r)
    -> (i -> Pipe Void i Void () m r) -> i -> Pipe l i o u m r
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe Void i Void () m r
    p) (Pipe l i o u m r -> u -> Pipe l i o u m r
    forall a b. a -> b -> a
    const (Pipe l i o u m r -> u -> Pipe l i o u m r)
    -> Pipe l i o u m r -> u -> Pipe l i o u m r
    forall a b. (a -> b) -> a -> b
    $ Pipe Void i Void () m r -> Pipe l i o u m r
    go (Pipe Void i Void () m r -> Pipe l i o u m r)
    -> Pipe Void i Void () m r -> Pipe l i o u m r
    forall a b. (a -> b) -> a -> b
    $ () -> Pipe Void i Void () m r
    c ())
        go (Done r :: r
    r) = r -> Pipe l i o u m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done r
    r
        go (PipeM mp :: m (Pipe Void i Void () m r)
    mp) = m (Pipe l i o u m r) -> Pipe l i o u m r
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe Void i Void () m r -> Pipe l i o u m r)
    -> m (Pipe Void i Void () m r) -> m (Pipe l i o u m r)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe Void i Void () m r -> Pipe l i o u m r
    go m (Pipe Void i Void () m r)
    mp)
        go (Leftover _ l :: Void
    l) = Void -> Pipe l i o u m r
    forall a. Void -> a
    absurd Void
    l

    conduitToPipe :: Monad m => Conduit i m o -> Pipe l i o u m ()
    conduitToPipe :: Conduit i m o -> Pipe l i o u m ()
    conduitToPipe =
        Pipe Void i o () m () -> Pipe l i o u m ()
    forall (m :: * -> *) i o l u.
    Monad m =>
    Pipe Void i o () m () -> Pipe l i o u m ()
    go (Pipe Void i o () m () -> Pipe l i o u m ())
    -> (Conduit i m o -> Pipe Void i o () m ())
    -> Conduit i m o
    -> Pipe l i o u m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Pipe i i o () m () -> Pipe Void i o () m ()
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers (Pipe i i o () m () -> Pipe Void i o () m ())
    -> (Conduit i m o -> Pipe i i o () m ())
    -> Conduit i m o
    -> Pipe Void i o () m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Conduit i m o -> (() -> Pipe i i o () m ()) -> Pipe i i o () m ())
    -> (() -> Pipe i i o () m ())
    -> Conduit i m o
    -> Pipe i i o () m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Conduit i m o -> (() -> Pipe i i o () m ()) -> Pipe i i o () m ()
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT () -> Pipe i i o () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done
      where
        go :: Pipe Void i o () m () -> Pipe l i o u m ()
    go (HaveOutput p :: Pipe Void i o () m ()
    p o :: o
    o) = Pipe l i o u m () -> o -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe Void i o () m () -> Pipe l i o u m ()
    go Pipe Void i o () m ()
    p) o
    o
        go (NeedInput p :: i -> Pipe Void i o () m ()
    p c :: () -> Pipe Void i o () m ()
    c) = (i -> Pipe l i o u m ())
    -> (u -> Pipe l i o u m ()) -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe Void i o () m () -> Pipe l i o u m ()
    go (Pipe Void i o () m () -> Pipe l i o u m ())
    -> (i -> Pipe Void i o () m ()) -> i -> Pipe l i o u m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe Void i o () m ()
    p) (Pipe l i o u m () -> u -> Pipe l i o u m ()
    forall a b. a -> b -> a
    const (Pipe l i o u m () -> u -> Pipe l i o u m ())
    -> Pipe l i o u m () -> u -> Pipe l i o u m ()
    forall a b. (a -> b) -> a -> b
    $ Pipe Void i o () m () -> Pipe l i o u m ()
    go (Pipe Void i o () m () -> Pipe l i o u m ())
    -> Pipe Void i o () m () -> Pipe l i o u m ()
    forall a b. (a -> b) -> a -> b
    $ () -> Pipe Void i o () m ()
    c ())
        go (Done ()) = () -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done ()
        go (PipeM mp :: m (Pipe Void i o () m ())
    mp) = m (Pipe l i o u m ()) -> Pipe l i o u m ()
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe Void i o () m () -> Pipe l i o u m ())
    -> m (Pipe Void i o () m ()) -> m (Pipe l i o u m ())
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe Void i o () m () -> Pipe l i o u m ()
    go m (Pipe Void i o () m ())
    mp)
        go (Leftover _ l :: Void
    l) = Void -> Pipe l i o u m ()
    forall a. Void -> a
    absurd Void
    l

    -- | Generalize a 'Source' to a 'Producer'.
    --
    -- Since 1.0.0
    toProducer :: Monad m => Source m a -> Producer m a
    toProducer :: Source m a -> Producer m a
    toProducer (ConduitT c0 :: forall b. (() -> Pipe () () a () m b) -> Pipe () () a () m b
    c0) = (forall b. (() -> Pipe i i a () m b) -> Pipe i i a () m b)
    -> ConduitT i a m ()
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (() -> Pipe i i a () m b) -> Pipe i i a () m b)
     -> ConduitT i a m ())
    -> (forall b. (() -> Pipe i i a () m b) -> Pipe i i a () m b)
    -> ConduitT i a m ()
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe i i a () m b
    rest -> let
        go :: Pipe () () a () m () -> Pipe i i a () m b
    go (HaveOutput p :: Pipe () () a () m ()
    p o :: a
    o) = Pipe i i a () m b -> a -> Pipe i i a () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe () () a () m () -> Pipe i i a () m b
    go Pipe () () a () m ()
    p) a
    o
        go (NeedInput _ c :: () -> Pipe () () a () m ()
    c) = Pipe () () a () m () -> Pipe i i a () m b
    go (() -> Pipe () () a () m ()
    c ())
        go (Done r :: ()
    r) = () -> Pipe i i a () m b
    rest ()
    r
        go (PipeM mp :: m (Pipe () () a () m ())
    mp) = m (Pipe i i a () m b) -> Pipe i i a () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () a () m () -> Pipe i i a () m b)
    -> m (Pipe () () a () m ()) -> m (Pipe i i a () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe () () a () m () -> Pipe i i a () m b
    go m (Pipe () () a () m ())
    mp)
        go (Leftover p :: Pipe () () a () m ()
    p ()) = Pipe () () a () m () -> Pipe i i a () m b
    go Pipe () () a () m ()
    p
        in Pipe () () a () m () -> Pipe i i a () m b
    go ((() -> Pipe () () a () m ()) -> Pipe () () a () m ()
    forall b. (() -> Pipe () () a () m b) -> Pipe () () a () m b
    c0 () -> Pipe () () a () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Generalize a 'Sink' to a 'Consumer'.
    --
    -- Since 1.0.0
    toConsumer :: Monad m => Sink a m b -> Consumer a m b
    toConsumer :: Sink a m b -> Consumer a m b
    toConsumer (ConduitT c0 :: forall b. (b -> Pipe a a Void () m b) -> Pipe a a Void () m b
    c0) = (forall b. (b -> Pipe a a o () m b) -> Pipe a a o () m b)
    -> ConduitT a o m b
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (b -> Pipe a a o () m b) -> Pipe a a o () m b)
     -> ConduitT a o m b)
    -> (forall b. (b -> Pipe a a o () m b) -> Pipe a a o () m b)
    -> ConduitT a o m b
    forall a b. (a -> b) -> a -> b
    $ \rest :: b -> Pipe a a o () m b
    rest -> let
        go :: Pipe a a Void () m b -> Pipe a a o () m b
    go (HaveOutput _ o :: Void
    o) = Void -> Pipe a a o () m b
    forall a. Void -> a
    absurd Void
    o
        go (NeedInput p :: a -> Pipe a a Void () m b
    p c :: () -> Pipe a a Void () m b
    c) = (a -> Pipe a a o () m b)
    -> (() -> Pipe a a o () m b) -> Pipe a a o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe a a Void () m b -> Pipe a a o () m b
    go (Pipe a a Void () m b -> Pipe a a o () m b)
    -> (a -> Pipe a a Void () m b) -> a -> Pipe a a o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> Pipe a a Void () m b
    p) (Pipe a a Void () m b -> Pipe a a o () m b
    go (Pipe a a Void () m b -> Pipe a a o () m b)
    -> (() -> Pipe a a Void () m b) -> () -> Pipe a a o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe a a Void () m b
    c)
        go (Done r :: b
    r) = b -> Pipe a a o () m b
    rest b
    r
        go (PipeM mp :: m (Pipe a a Void () m b)
    mp) = m (Pipe a a o () m b) -> Pipe a a o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe a a Void () m b -> Pipe a a o () m b)
    -> m (Pipe a a Void () m b) -> m (Pipe a a o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe a a Void () m b -> Pipe a a o () m b
    go m (Pipe a a Void () m b)
    mp)
        go (Leftover p :: Pipe a a Void () m b
    p l :: a
    l) = Pipe a a o () m b -> a -> Pipe a a o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe a a Void () m b -> Pipe a a o () m b
    go Pipe a a Void () m b
    p) a
    l
        in Pipe a a Void () m b -> Pipe a a o () m b
    go ((b -> Pipe a a Void () m b) -> Pipe a a Void () m b
    forall b. (b -> Pipe a a Void () m b) -> Pipe a a Void () m b
    c0 b -> Pipe a a Void () m b
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Catch all exceptions thrown by the current component of the pipeline.
    --
    -- Note: this will /not/ catch exceptions thrown by other components! For
    -- example, if an exception is thrown in a @Source@ feeding to a @Sink@, and
    -- the @Sink@ uses @catchC@, the exception will /not/ be caught.
    --
    -- Due to this behavior (as well as lack of async exception safety), you
    -- should not try to implement combinators such as @onException@ in terms of this
    -- primitive function.
    --
    -- Note also that the exception handling will /not/ be applied to any
    -- finalizers generated by this conduit.
    --
    -- Since 1.0.11
    catchC :: (MonadUnliftIO m, Exception e)
           => ConduitT i o m r
           -> (e -> ConduitT i o m r)
           -> ConduitT i o m r
    catchC :: ConduitT i o m r -> (e -> ConduitT i o m r) -> ConduitT i o m r
    catchC (ConduitT p0 :: forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    p0) onErr :: e -> ConduitT i o m r
    onErr = (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m r)
    -> (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i i o () m b
    rest -> let
        go :: Pipe i i o () m r -> Pipe i i o () m b
    go (Done r :: r
    r) = r -> Pipe i i o () m b
    rest r
    r
        go (PipeM mp :: m (Pipe i i o () m r)
    mp) = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i i o () m b) -> Pipe i i o () m b)
    -> m (Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ ((forall a. m a -> IO a) -> IO (Pipe i i o () m b))
    -> m (Pipe i i o () m b)
    forall (m :: * -> *) b.
    MonadUnliftIO m =>
    ((forall a. m a -> IO a) -> IO b) -> m b
    withRunInIO (((forall a. m a -> IO a) -> IO (Pipe i i o () m b))
     -> m (Pipe i i o () m b))
    -> ((forall a. m a -> IO a) -> IO (Pipe i i o () m b))
    -> m (Pipe i i o () m b)
    forall a b. (a -> b) -> a -> b
    $ \run :: forall a. m a -> IO a
    run -> IO (Pipe i i o () m b)
    -> (e -> IO (Pipe i i o () m b)) -> IO (Pipe i i o () m b)
    forall e a. Exception e => IO a -> (e -> IO a) -> IO a
    E.catch (m (Pipe i i o () m b) -> IO (Pipe i i o () m b)
    forall a. m a -> IO a
    run ((Pipe i i o () m r -> Pipe i i o () m b)
    -> m (Pipe i i o () m r) -> m (Pipe i i o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe i i o () m r -> Pipe i i o () m b
    go m (Pipe i i o () m r)
    mp))
            (Pipe i i o () m b -> IO (Pipe i i o () m b)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pipe i i o () m b -> IO (Pipe i i o () m b))
    -> (e -> Pipe i i o () m b) -> e -> IO (Pipe i i o () m b)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ConduitT i o m r -> (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> (r -> Pipe i i o () m b)
    -> ConduitT i o m r
    -> Pipe i i o () m b
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip ConduitT i o m r -> (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT r -> Pipe i i o () m b
    rest (ConduitT i o m r -> Pipe i i o () m b)
    -> (e -> ConduitT i o m r) -> e -> Pipe i i o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . e -> ConduitT i o m r
    onErr)
        go (Leftover p :: Pipe i i o () m r
    p i :: i
    i) = Pipe i i o () m b -> i -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o () m r -> Pipe i i o () m b
    go Pipe i i o () m r
    p) i
    i
        go (NeedInput x :: i -> Pipe i i o () m r
    x y :: () -> Pipe i i o () m r
    y) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe i i o () m r -> Pipe i i o () m b
    go (Pipe i i o () m r -> Pipe i i o () m b)
    -> (i -> Pipe i i o () m r) -> i -> Pipe i i o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe i i o () m r
    x) (Pipe i i o () m r -> Pipe i i o () m b
    go (Pipe i i o () m r -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m r) -> () -> Pipe i i o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i i o () m r
    y)
        go (HaveOutput p :: Pipe i i o () m r
    p o :: o
    o) = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i i o () m r -> Pipe i i o () m b
    go Pipe i i o () m r
    p) o
    o
        in Pipe i i o () m r -> Pipe i i o () m b
    go ((r -> Pipe i i o () m r) -> Pipe i i o () m r
    forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    p0 r -> Pipe i i o () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)
    {-# INLINE catchC #-}

    -- | The same as @flip catchC@.
    --
    -- Since 1.0.11
    handleC :: (MonadUnliftIO m, Exception e)
            => (e -> ConduitT i o m r)
            -> ConduitT i o m r
            -> ConduitT i o m r
    handleC :: (e -> ConduitT i o m r) -> ConduitT i o m r -> ConduitT i o m r
    handleC = (ConduitT i o m r -> (e -> ConduitT i o m r) -> ConduitT i o m r)
    -> (e -> ConduitT i o m r) -> ConduitT i o m r -> ConduitT i o m r
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip ConduitT i o m r -> (e -> ConduitT i o m r) -> ConduitT i o m r
    forall (m :: * -> *) e i o r.
    (MonadUnliftIO m, Exception e) =>
    ConduitT i o m r -> (e -> ConduitT i o m r) -> ConduitT i o m r
    catchC
    {-# INLINE handleC #-}

    -- | A version of @try@ for use within a pipeline. See the comments in @catchC@
    -- for more details.
    --
    -- Since 1.0.11
    tryC :: (MonadUnliftIO m, Exception e)
         => ConduitT i o m r
         -> ConduitT i o m (Either e r)
    tryC :: ConduitT i o m r -> ConduitT i o m (Either e r)
    tryC c :: ConduitT i o m r
    c = (r -> Either e r)
    -> ConduitT i o m r -> ConduitT i o m (Either e r)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap r -> Either e r
    forall a b. b -> Either a b
    Right ConduitT i o m r
    c ConduitT i o m (Either e r)
    -> (e -> ConduitT i o m (Either e r))
    -> ConduitT i o m (Either e r)
    forall (m :: * -> *) e i o r.
    (MonadUnliftIO m, Exception e) =>
    ConduitT i o m r -> (e -> ConduitT i o m r) -> ConduitT i o m r
    `catchC` (Either e r -> ConduitT i o m (Either e r)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Either e r -> ConduitT i o m (Either e r))
    -> (e -> Either e r) -> e -> ConduitT i o m (Either e r)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . e -> Either e r
    forall a b. a -> Either a b
    Left)
    {-# INLINE tryC #-}

    -- | Combines two sinks. The new sink will complete when both input sinks have
    --   completed.
    --
    -- Any leftovers are discarded.
    --
    -- Since 0.4.1
    zipSinks :: Monad m => Sink i m r -> Sink i m r' -> Sink i m (r, r')
    zipSinks :: Sink i m r -> Sink i m r' -> Sink i m (r, r')
    zipSinks (ConduitT x0 :: forall b. (r -> Pipe i i Void () m b) -> Pipe i i Void () m b
    x0) (ConduitT y0 :: forall b. (r' -> Pipe i i Void () m b) -> Pipe i i Void () m b
    y0) = (forall b.
     ((r, r') -> Pipe i i Void () m b) -> Pipe i i Void () m b)
    -> Sink i m (r, r')
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b.
      ((r, r') -> Pipe i i Void () m b) -> Pipe i i Void () m b)
     -> Sink i m (r, r'))
    -> (forall b.
        ((r, r') -> Pipe i i Void () m b) -> Pipe i i Void () m b)
    -> Sink i m (r, r')
    forall a b. (a -> b) -> a -> b
    $ \rest :: (r, r') -> Pipe i i Void () m b
    rest -> let
        Leftover _  i :: Void
    i    >< :: Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< _                = Void -> Pipe i i Void () m b
    forall a. Void -> a
    absurd Void
    i
        _                >< Leftover _  i :: Void
    i    = Void -> Pipe i i Void () m b
    forall a. Void -> a
    absurd Void
    i
        HaveOutput _ o :: Void
    o   >< _                = Void -> Pipe i i Void () m b
    forall a. Void -> a
    absurd Void
    o
        _                >< HaveOutput _ o :: Void
    o   = Void -> Pipe i i Void () m b
    forall a. Void -> a
    absurd Void
    o

        PipeM mx :: m (Pipe Void i Void () m r)
    mx         >< y :: Pipe Void i Void () m r'
    y                = m (Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe Void i Void () m r -> Pipe i i Void () m b)
    -> m (Pipe Void i Void () m r) -> m (Pipe i i Void () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< Pipe Void i Void () m r'
    y) m (Pipe Void i Void () m r)
    mx)
        x :: Pipe Void i Void () m r
    x                >< PipeM my :: m (Pipe Void i Void () m r')
    my         = m (Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe Void i Void () m r' -> Pipe i i Void () m b)
    -> m (Pipe Void i Void () m r') -> m (Pipe i i Void () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe Void i Void () m r
    x Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    ><) m (Pipe Void i Void () m r')
    my)
        Done x :: r
    x           >< Done y :: r'
    y           = (r, r') -> Pipe i i Void () m b
    rest (r
    x, r'
    y)
        NeedInput px :: i -> Pipe Void i Void () m r
    px cx :: () -> Pipe Void i Void () m r
    cx  >< NeedInput py :: i -> Pipe Void i Void () m r'
    py cy :: () -> Pipe Void i Void () m r'
    cy  = (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> i -> Pipe Void i Void () m r
    px i
    i Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< i -> Pipe Void i Void () m r'
    py i
    i) (\() -> () -> Pipe Void i Void () m r
    cx () Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< () -> Pipe Void i Void () m r'
    cy ())
        NeedInput px :: i -> Pipe Void i Void () m r
    px cx :: () -> Pipe Void i Void () m r
    cx  >< y :: Pipe Void i Void () m r'
    y@Done{}         = (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> i -> Pipe Void i Void () m r
    px i
    i Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< Pipe Void i Void () m r'
    y)    (\u :: ()
    u -> () -> Pipe Void i Void () m r
    cx ()
    u Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< Pipe Void i Void () m r'
    y)
        x :: Pipe Void i Void () m r
    x@Done{}         >< NeedInput py :: i -> Pipe Void i Void () m r'
    py cy :: () -> Pipe Void i Void () m r'
    cy  = (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> Pipe Void i Void () m r
    x Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< i -> Pipe Void i Void () m r'
    py i
    i)    (\u :: ()
    u -> Pipe Void i Void () m r
    x Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< () -> Pipe Void i Void () m r'
    cy ()
    u)
        in Pipe i i Void () m r -> Pipe Void i Void () m r
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers ((r -> Pipe i i Void () m r) -> Pipe i i Void () m r
    forall b. (r -> Pipe i i Void () m b) -> Pipe i i Void () m b
    x0 r -> Pipe i i Void () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) Pipe Void i Void () m r
    -> Pipe Void i Void () m r' -> Pipe i i Void () m b
    >< Pipe i i Void () m r' -> Pipe Void i Void () m r'
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers ((r' -> Pipe i i Void () m r') -> Pipe i i Void () m r'
    forall b. (r' -> Pipe i i Void () m b) -> Pipe i i Void () m b
    y0 r' -> Pipe i i Void () m r'
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Combines two sources. The new source will stop producing once either
    --   source has been exhausted.
    --
    -- Since 1.0.13
    zipSources :: Monad m => Source m a -> Source m b -> Source m (a, b)
    zipSources :: Source m a -> Source m b -> Source m (a, b)
    zipSources (ConduitT left0 :: forall b. (() -> Pipe () () a () m b) -> Pipe () () a () m b
    left0) (ConduitT right0 :: forall b. (() -> Pipe () () b () m b) -> Pipe () () b () m b
    right0) = (forall b.
     (() -> Pipe () () (a, b) () m b) -> Pipe () () (a, b) () m b)
    -> Source m (a, b)
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b.
      (() -> Pipe () () (a, b) () m b) -> Pipe () () (a, b) () m b)
     -> Source m (a, b))
    -> (forall b.
        (() -> Pipe () () (a, b) () m b) -> Pipe () () (a, b) () m b)
    -> Source m (a, b)
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe () () (a, b) () m b
    rest -> let
        go :: Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go (Leftover left :: Pipe () () a () m ()
    left ()) right :: Pipe () () b () m ()
    right = Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go Pipe () () a () m ()
    left Pipe () () b () m ()
    right
        go left :: Pipe () () a () m ()
    left (Leftover right :: Pipe () () b () m ()
    right ())  = Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go Pipe () () a () m ()
    left Pipe () () b () m ()
    right
        go (Done ()) (Done ()) = () -> Pipe () () (a, b) () m b
    rest ()
        go (Done ()) (HaveOutput _ _) = () -> Pipe () () (a, b) () m b
    rest ()
        go (HaveOutput _ _) (Done ()) = () -> Pipe () () (a, b) () m b
    rest ()
        go (Done ()) (PipeM _) = () -> Pipe () () (a, b) () m b
    rest ()
        go (PipeM _) (Done ()) = () -> Pipe () () (a, b) () m b
    rest ()
        go (PipeM mx :: m (Pipe () () a () m ())
    mx) (PipeM my :: m (Pipe () () b () m ())
    my) = m (Pipe () () (a, b) () m b) -> Pipe () () (a, b) () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () a () m ()
     -> Pipe () () b () m () -> Pipe () () (a, b) () m b)
    -> m (Pipe () () a () m ())
    -> m (Pipe () () b () m ())
    -> m (Pipe () () (a, b) () m b)
    forall (m :: * -> *) a1 a2 r.
    Monad m =>
    (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
    liftM2 Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go m (Pipe () () a () m ())
    mx m (Pipe () () b () m ())
    my)
        go (PipeM mx :: m (Pipe () () a () m ())
    mx) y :: Pipe () () b () m ()
    y@HaveOutput{} = m (Pipe () () (a, b) () m b) -> Pipe () () (a, b) () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () a () m () -> Pipe () () (a, b) () m b)
    -> m (Pipe () () a () m ()) -> m (Pipe () () (a, b) () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (\x :: Pipe () () a () m ()
    x -> Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go Pipe () () a () m ()
    x Pipe () () b () m ()
    y) m (Pipe () () a () m ())
    mx)
        go x :: Pipe () () a () m ()
    x@HaveOutput{} (PipeM my :: m (Pipe () () b () m ())
    my) = m (Pipe () () (a, b) () m b) -> Pipe () () (a, b) () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () b () m () -> Pipe () () (a, b) () m b)
    -> m (Pipe () () b () m ()) -> m (Pipe () () (a, b) () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go Pipe () () a () m ()
    x) m (Pipe () () b () m ())
    my)
        go (HaveOutput srcx :: Pipe () () a () m ()
    srcx x :: a
    x) (HaveOutput srcy :: Pipe () () b () m ()
    srcy y :: b
    y) = Pipe () () (a, b) () m b -> (a, b) -> Pipe () () (a, b) () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go Pipe () () a () m ()
    srcx Pipe () () b () m ()
    srcy) (a
    x, b
    y)
        go (NeedInput _ c :: () -> Pipe () () a () m ()
    c) right :: Pipe () () b () m ()
    right = Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go (() -> Pipe () () a () m ()
    c ()) Pipe () () b () m ()
    right
        go left :: Pipe () () a () m ()
    left (NeedInput _ c :: () -> Pipe () () b () m ()
    c) = Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go Pipe () () a () m ()
    left (() -> Pipe () () b () m ()
    c ())
        in Pipe () () a () m ()
    -> Pipe () () b () m () -> Pipe () () (a, b) () m b
    go ((() -> Pipe () () a () m ()) -> Pipe () () a () m ()
    forall b. (() -> Pipe () () a () m b) -> Pipe () () a () m b
    left0 () -> Pipe () () a () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) ((() -> Pipe () () b () m ()) -> Pipe () () b () m ()
    forall b. (() -> Pipe () () b () m b) -> Pipe () () b () m b
    right0 () -> Pipe () () b () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Combines two sources. The new source will stop producing once either
    --   source has been exhausted.
    --
    -- Since 1.0.13
    zipSourcesApp :: Monad m => Source m (a -> b) -> Source m a -> Source m b
    zipSourcesApp :: Source m (a -> b) -> Source m a -> Source m b
    zipSourcesApp (ConduitT left0 :: forall b.
    (() -> Pipe () () (a -> b) () m b) -> Pipe () () (a -> b) () m b
    left0) (ConduitT right0 :: forall b. (() -> Pipe () () a () m b) -> Pipe () () a () m b
    right0) = (forall b. (() -> Pipe () () b () m b) -> Pipe () () b () m b)
    -> Source m b
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (() -> Pipe () () b () m b) -> Pipe () () b () m b)
     -> Source m b)
    -> (forall b. (() -> Pipe () () b () m b) -> Pipe () () b () m b)
    -> Source m b
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe () () b () m b
    rest -> let
        go :: Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go (Leftover left :: Pipe () () (a -> b) () m ()
    left ()) right :: Pipe () () a () m ()
    right = Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go Pipe () () (a -> b) () m ()
    left Pipe () () a () m ()
    right
        go left :: Pipe () () (a -> b) () m ()
    left (Leftover right :: Pipe () () a () m ()
    right ())  = Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go Pipe () () (a -> b) () m ()
    left Pipe () () a () m ()
    right
        go (Done ()) (Done ()) = () -> Pipe () () b () m b
    rest ()
        go (Done ()) (HaveOutput _ _) = () -> Pipe () () b () m b
    rest ()
        go (HaveOutput _ _) (Done ()) = () -> Pipe () () b () m b
    rest ()
        go (Done ()) (PipeM _) = () -> Pipe () () b () m b
    rest ()
        go (PipeM _) (Done ()) = () -> Pipe () () b () m b
    rest ()
        go (PipeM mx :: m (Pipe () () (a -> b) () m ())
    mx) (PipeM my :: m (Pipe () () a () m ())
    my) = m (Pipe () () b () m b) -> Pipe () () b () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () (a -> b) () m ()
     -> Pipe () () a () m () -> Pipe () () b () m b)
    -> m (Pipe () () (a -> b) () m ())
    -> m (Pipe () () a () m ())
    -> m (Pipe () () b () m b)
    forall (m :: * -> *) a1 a2 r.
    Monad m =>
    (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
    liftM2 Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go m (Pipe () () (a -> b) () m ())
    mx m (Pipe () () a () m ())
    my)
        go (PipeM mx :: m (Pipe () () (a -> b) () m ())
    mx) y :: Pipe () () a () m ()
    y@HaveOutput{} = m (Pipe () () b () m b) -> Pipe () () b () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () (a -> b) () m () -> Pipe () () b () m b)
    -> m (Pipe () () (a -> b) () m ()) -> m (Pipe () () b () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (\x :: Pipe () () (a -> b) () m ()
    x -> Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go Pipe () () (a -> b) () m ()
    x Pipe () () a () m ()
    y) m (Pipe () () (a -> b) () m ())
    mx)
        go x :: Pipe () () (a -> b) () m ()
    x@HaveOutput{} (PipeM my :: m (Pipe () () a () m ())
    my) = m (Pipe () () b () m b) -> Pipe () () b () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe () () a () m () -> Pipe () () b () m b)
    -> m (Pipe () () a () m ()) -> m (Pipe () () b () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go Pipe () () (a -> b) () m ()
    x) m (Pipe () () a () m ())
    my)
        go (HaveOutput srcx :: Pipe () () (a -> b) () m ()
    srcx x :: a -> b
    x) (HaveOutput srcy :: Pipe () () a () m ()
    srcy y :: a
    y) = Pipe () () b () m b -> b -> Pipe () () b () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go Pipe () () (a -> b) () m ()
    srcx Pipe () () a () m ()
    srcy) (a -> b
    x a
    y)
        go (NeedInput _ c :: () -> Pipe () () (a -> b) () m ()
    c) right :: Pipe () () a () m ()
    right = Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go (() -> Pipe () () (a -> b) () m ()
    c ()) Pipe () () a () m ()
    right
        go left :: Pipe () () (a -> b) () m ()
    left (NeedInput _ c :: () -> Pipe () () a () m ()
    c) = Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go Pipe () () (a -> b) () m ()
    left (() -> Pipe () () a () m ()
    c ())
        in Pipe () () (a -> b) () m ()
    -> Pipe () () a () m () -> Pipe () () b () m b
    go ((() -> Pipe () () (a -> b) () m ()) -> Pipe () () (a -> b) () m ()
    forall b.
    (() -> Pipe () () (a -> b) () m b) -> Pipe () () (a -> b) () m b
    left0 () -> Pipe () () (a -> b) () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) ((() -> Pipe () () a () m ()) -> Pipe () () a () m ()
    forall b. (() -> Pipe () () a () m b) -> Pipe () () a () m b
    right0 () -> Pipe () () a () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- |
    --
    -- Since 1.0.17
    zipConduitApp
        :: Monad m
        => ConduitT i o m (x -> y)
        -> ConduitT i o m x
        -> ConduitT i o m y
    zipConduitApp :: ConduitT i o m (x -> y) -> ConduitT i o m x -> ConduitT i o m y
    zipConduitApp (ConduitT left0 :: forall b. ((x -> y) -> Pipe i i o () m b) -> Pipe i i o () m b
    left0) (ConduitT right0 :: forall b. (x -> Pipe i i o () m b) -> Pipe i i o () m b
    right0) = (forall b. (y -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m y
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (y -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m y)
    -> (forall b. (y -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m y
    forall a b. (a -> b) -> a -> b
    $ \rest :: y -> Pipe i i o () m b
    rest -> let
        go :: Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go (Done f :: x -> y
    f) (Done x :: x
    x) = y -> Pipe i i o () m b
    rest (x -> y
    f x
    x)
        go (PipeM mx :: m (Pipe Void i o () m (x -> y))
    mx) y :: Pipe Void i o () m x
    y = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe Void i o () m (x -> y)
     -> Pipe Void i o () m x -> Pipe i i o () m b)
    -> Pipe Void i o () m x
    -> Pipe Void i o () m (x -> y)
    -> Pipe i i o () m b
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go Pipe Void i o () m x
    y (Pipe Void i o () m (x -> y) -> Pipe i i o () m b)
    -> m (Pipe Void i o () m (x -> y)) -> m (Pipe i i o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    `liftM` m (Pipe Void i o () m (x -> y))
    mx)
        go x :: Pipe Void i o () m (x -> y)
    x (PipeM my :: m (Pipe Void i o () m x)
    my) = m (Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go Pipe Void i o () m (x -> y)
    x (Pipe Void i o () m x -> Pipe i i o () m b)
    -> m (Pipe Void i o () m x) -> m (Pipe i i o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    `liftM` m (Pipe Void i o () m x)
    my)
        go (HaveOutput x :: Pipe Void i o () m (x -> y)
    x o :: o
    o) y :: Pipe Void i o () m x
    y = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go Pipe Void i o () m (x -> y)
    x Pipe Void i o () m x
    y) o
    o
        go x :: Pipe Void i o () m (x -> y)
    x (HaveOutput y :: Pipe Void i o () m x
    y o :: o
    o) = Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go Pipe Void i o () m (x -> y)
    x Pipe Void i o () m x
    y) o
    o
        go (Leftover _ i :: Void
    i) _ = Void -> Pipe i i o () m b
    forall a. Void -> a
    absurd Void
    i
        go _ (Leftover _ i :: Void
    i) = Void -> Pipe i i o () m b
    forall a. Void -> a
    absurd Void
    i
        go (NeedInput px :: i -> Pipe Void i o () m (x -> y)
    px cx :: () -> Pipe Void i o () m (x -> y)
    cx) (NeedInput py :: i -> Pipe Void i o () m x
    py cy :: () -> Pipe Void i o () m x
    cy) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput
            (\i :: i
    i -> Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go (i -> Pipe Void i o () m (x -> y)
    px i
    i) (i -> Pipe Void i o () m x
    py i
    i))
            (\u :: ()
    u -> Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go (() -> Pipe Void i o () m (x -> y)
    cx ()
    u) (() -> Pipe Void i o () m x
    cy ()
    u))
        go (NeedInput px :: i -> Pipe Void i o () m (x -> y)
    px cx :: () -> Pipe Void i o () m (x -> y)
    cx) (Done y :: x
    y) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput
            (\i :: i
    i -> Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go (i -> Pipe Void i o () m (x -> y)
    px i
    i) (x -> Pipe Void i o () m x
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done x
    y))
            (\u :: ()
    u -> Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go (() -> Pipe Void i o () m (x -> y)
    cx ()
    u) (x -> Pipe Void i o () m x
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done x
    y))
        go (Done x :: x -> y
    x) (NeedInput py :: i -> Pipe Void i o () m x
    py cy :: () -> Pipe Void i o () m x
    cy) = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput
            (\i :: i
    i -> Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go ((x -> y) -> Pipe Void i o () m (x -> y)
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done x -> y
    x) (i -> Pipe Void i o () m x
    py i
    i))
            (\u :: ()
    u -> Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go ((x -> y) -> Pipe Void i o () m (x -> y)
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done x -> y
    x) (() -> Pipe Void i o () m x
    cy ()
    u))
      in Pipe Void i o () m (x -> y)
    -> Pipe Void i o () m x -> Pipe i i o () m b
    go (Pipe i i o () m (x -> y) -> Pipe Void i o () m (x -> y)
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers (Pipe i i o () m (x -> y) -> Pipe Void i o () m (x -> y))
    -> Pipe i i o () m (x -> y) -> Pipe Void i o () m (x -> y)
    forall a b. (a -> b) -> a -> b
    $ ((x -> y) -> Pipe i i o () m (x -> y)) -> Pipe i i o () m (x -> y)
    forall b. ((x -> y) -> Pipe i i o () m b) -> Pipe i i o () m b
    left0 (x -> y) -> Pipe i i o () m (x -> y)
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) (Pipe i i o () m x -> Pipe Void i o () m x
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers (Pipe i i o () m x -> Pipe Void i o () m x)
    -> Pipe i i o () m x -> Pipe Void i o () m x
    forall a b. (a -> b) -> a -> b
    $ (x -> Pipe i i o () m x) -> Pipe i i o () m x
    forall b. (x -> Pipe i i o () m b) -> Pipe i i o () m b
    right0 x -> Pipe i i o () m x
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Same as normal fusion (e.g. @=$=@), except instead of discarding leftovers
    -- from the downstream component, return them.
    --
    -- Since 1.0.17
    fuseReturnLeftovers :: Monad m
                        => ConduitT a b m ()
                        -> ConduitT b c m r
                        -> ConduitT a c m (r, [b])
    fuseReturnLeftovers :: ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m (r, [b])
    fuseReturnLeftovers (ConduitT left0 :: forall b. (() -> Pipe a a b () m b) -> Pipe a a b () m b
    left0) (ConduitT right0 :: forall b. (r -> Pipe b b c () m b) -> Pipe b b c () m b
    right0) = (forall b. ((r, [b]) -> Pipe a a c () m b) -> Pipe a a c () m b)
    -> ConduitT a c m (r, [b])
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. ((r, [b]) -> Pipe a a c () m b) -> Pipe a a c () m b)
     -> ConduitT a c m (r, [b]))
    -> (forall b. ((r, [b]) -> Pipe a a c () m b) -> Pipe a a c () m b)
    -> ConduitT a c m (r, [b])
    forall a b. (a -> b) -> a -> b
    $ \rest :: (r, [b]) -> Pipe a a c () m b
    rest -> let
        goRight :: [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight bs :: [b]
    bs left :: Pipe a a b () m ()
    left right :: Pipe b b c () m r
    right =
            case Pipe b b c () m r
    right of
                HaveOutput p :: Pipe b b c () m r
    p o :: c
    o -> Pipe a a c () m b -> c -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe b b c () m r -> Pipe a a c () m b
    recurse Pipe b b c () m r
    p) c
    o
                NeedInput rp :: b -> Pipe b b c () m r
    rp rc :: () -> Pipe b b c () m r
    rc  ->
                    case [b]
    bs of
                        [] -> (b -> Pipe b b c () m r)
    -> (() -> Pipe b b c () m r)
    -> Pipe a a b () m ()
    -> Pipe a a c () m b
    goLeft b -> Pipe b b c () m r
    rp () -> Pipe b b c () m r
    rc Pipe a a b () m ()
    left
                        b :: b
    b:bs' :: [b]
    bs' -> [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight [b]
    bs' Pipe a a b () m ()
    left (b -> Pipe b b c () m r
    rp b
    b)
                Done r2 :: r
    r2          -> (r, [b]) -> Pipe a a c () m b
    rest (r
    r2, [b]
    bs)
                PipeM mp :: m (Pipe b b c () m r)
    mp         -> m (Pipe a a c () m b) -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe b b c () m r -> Pipe a a c () m b)
    -> m (Pipe b b c () m r) -> m (Pipe a a c () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe b b c () m r -> Pipe a a c () m b
    recurse m (Pipe b b c () m r)
    mp)
                Leftover p :: Pipe b b c () m r
    p b :: b
    b     -> [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight (b
    bb -> [b] -> [b]
    forall a. a -> [a] -> [a]
    :[b]
    bs) Pipe a a b () m ()
    left Pipe b b c () m r
    p
          where
            recurse :: Pipe b b c () m r -> Pipe a a c () m b
    recurse = [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight [b]
    bs Pipe a a b () m ()
    left

        goLeft :: (b -> Pipe b b c () m r)
    -> (() -> Pipe b b c () m r)
    -> Pipe a a b () m ()
    -> Pipe a a c () m b
    goLeft rp :: b -> Pipe b b c () m r
    rp rc :: () -> Pipe b b c () m r
    rc left :: Pipe a a b () m ()
    left =
            case Pipe a a b () m ()
    left of
                HaveOutput left' :: Pipe a a b () m ()
    left' o :: b
    o        -> [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight [] Pipe a a b () m ()
    left' (b -> Pipe b b c () m r
    rp b
    o)
                NeedInput left' :: a -> Pipe a a b () m ()
    left' lc :: () -> Pipe a a b () m ()
    lc        -> (a -> Pipe a a c () m b)
    -> (() -> Pipe a a c () m b) -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe a a b () m () -> Pipe a a c () m b
    recurse (Pipe a a b () m () -> Pipe a a c () m b)
    -> (a -> Pipe a a b () m ()) -> a -> Pipe a a c () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> Pipe a a b () m ()
    left') (Pipe a a b () m () -> Pipe a a c () m b
    recurse (Pipe a a b () m () -> Pipe a a c () m b)
    -> (() -> Pipe a a b () m ()) -> () -> Pipe a a c () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe a a b () m ()
    lc)
                Done r1 :: ()
    r1                   -> [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight [] (() -> Pipe a a b () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done ()
    r1) (() -> Pipe b b c () m r
    rc ()
    r1)
                PipeM mp :: m (Pipe a a b () m ())
    mp                  -> m (Pipe a a c () m b) -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe a a b () m () -> Pipe a a c () m b)
    -> m (Pipe a a b () m ()) -> m (Pipe a a c () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe a a b () m () -> Pipe a a c () m b
    recurse m (Pipe a a b () m ())
    mp)
                Leftover left' :: Pipe a a b () m ()
    left' i :: a
    i          -> Pipe a a c () m b -> a -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe a a b () m () -> Pipe a a c () m b
    recurse Pipe a a b () m ()
    left') a
    i
          where
            recurse :: Pipe a a b () m () -> Pipe a a c () m b
    recurse = (b -> Pipe b b c () m r)
    -> (() -> Pipe b b c () m r)
    -> Pipe a a b () m ()
    -> Pipe a a c () m b
    goLeft b -> Pipe b b c () m r
    rp () -> Pipe b b c () m r
    rc
        in [b] -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight [] ((() -> Pipe a a b () m ()) -> Pipe a a b () m ()
    forall b. (() -> Pipe a a b () m b) -> Pipe a a b () m b
    left0 () -> Pipe a a b () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) ((r -> Pipe b b c () m r) -> Pipe b b c () m r
    forall b. (r -> Pipe b b c () m b) -> Pipe b b c () m b
    right0 r -> Pipe b b c () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Similar to @fuseReturnLeftovers@, but use the provided function to convert
    -- downstream leftovers to upstream leftovers.
    --
    -- Since 1.0.17
    fuseLeftovers
        :: Monad m
        => ([b] -> [a])
        -> ConduitT a b m ()
        -> ConduitT b c m r
        -> ConduitT a c m r
    fuseLeftovers :: ([b] -> [a])
    -> ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
    fuseLeftovers f :: [b] -> [a]
    f left :: ConduitT a b m ()
    left right :: ConduitT b c m r
    right = do
        (r :: r
    r, bs :: [b]
    bs) <- ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m (r, [b])
    forall (m :: * -> *) a b c r.
    Monad m =>
    ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m (r, [b])
    fuseReturnLeftovers ConduitT a b m ()
    left ConduitT b c m r
    right
        (a -> ConduitT a c m ()) -> [a] -> ConduitT a c m ()
    forall (t :: * -> *) (m :: * -> *) a b.
    (Foldable t, Monad m) =>
    (a -> m b) -> t a -> m ()
    mapM_ a -> ConduitT a c m ()
    forall i o (m :: * -> *). i -> ConduitT i o m ()
    leftover ([a] -> ConduitT a c m ()) -> [a] -> ConduitT a c m ()
    forall a b. (a -> b) -> a -> b
    $ [a] -> [a]
    forall a. [a] -> [a]
    reverse ([a] -> [a]) -> [a] -> [a]
    forall a b. (a -> b) -> a -> b
    $ [b] -> [a]
    f [b]
    bs
        r -> ConduitT a c m r
    forall (m :: * -> *) a. Monad m => a -> m a
    return r
    r

    -- | Connect a 'Conduit' to a sink and return the output of the sink
    -- together with a new 'Conduit'.
    --
    -- Since 1.0.17
    connectResumeConduit
        :: Monad m
        => SealedConduitT i o m ()
        -> ConduitT o Void m r
        -> ConduitT i Void m (SealedConduitT i o m (), r)
    connectResumeConduit :: SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    connectResumeConduit (SealedConduitT left0 :: Pipe i i o () m ()
    left0) (ConduitT right0 :: forall b. (r -> Pipe o o Void () m b) -> Pipe o o Void () m b
    right0) = (forall b.
     ((SealedConduitT i o m (), r) -> Pipe i i Void () m b)
     -> Pipe i i Void () m b)
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b.
      ((SealedConduitT i o m (), r) -> Pipe i i Void () m b)
      -> Pipe i i Void () m b)
     -> ConduitT i Void m (SealedConduitT i o m (), r))
    -> (forall b.
        ((SealedConduitT i o m (), r) -> Pipe i i Void () m b)
        -> Pipe i i Void () m b)
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    forall a b. (a -> b) -> a -> b
    $ \rest :: (SealedConduitT i o m (), r) -> Pipe i i Void () m b
    rest -> let
        goRight :: Pipe i i o () m () -> Pipe o o Void () m r -> Pipe i i Void () m b
    goRight left :: Pipe i i o () m ()
    left right :: Pipe o o Void () m r
    right =
            case Pipe o o Void () m r
    right of
                HaveOutput _ o :: Void
    o -> Void -> Pipe i i Void () m b
    forall a. Void -> a
    absurd Void
    o
                NeedInput rp :: o -> Pipe o o Void () m r
    rp rc :: () -> Pipe o o Void () m r
    rc -> (o -> Pipe o o Void () m r)
    -> (() -> Pipe o o Void () m r)
    -> Pipe i i o () m ()
    -> Pipe i i Void () m b
    goLeft o -> Pipe o o Void () m r
    rp () -> Pipe o o Void () m r
    rc Pipe i i o () m ()
    left
                Done r2 :: r
    r2 -> (SealedConduitT i o m (), r) -> Pipe i i Void () m b
    rest (Pipe i i o () m () -> SealedConduitT i o m ()
    forall i o (m :: * -> *) r.
    Pipe i i o () m r -> SealedConduitT i o m r
    SealedConduitT Pipe i i o () m ()
    left, r
    r2)
                PipeM mp :: m (Pipe o o Void () m r)
    mp -> m (Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe o o Void () m r -> Pipe i i Void () m b)
    -> m (Pipe o o Void () m r) -> m (Pipe i i Void () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe i i o () m () -> Pipe o o Void () m r -> Pipe i i Void () m b
    goRight Pipe i i o () m ()
    left) m (Pipe o o Void () m r)
    mp)
                Leftover p :: Pipe o o Void () m r
    p i :: o
    i -> Pipe i i o () m () -> Pipe o o Void () m r -> Pipe i i Void () m b
    goRight (Pipe i i o () m () -> o -> Pipe i i o () m ()
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput Pipe i i o () m ()
    left o
    i) Pipe o o Void () m r
    p

        goLeft :: (o -> Pipe o o Void () m r)
    -> (() -> Pipe o o Void () m r)
    -> Pipe i i o () m ()
    -> Pipe i i Void () m b
    goLeft rp :: o -> Pipe o o Void () m r
    rp rc :: () -> Pipe o o Void () m r
    rc left :: Pipe i i o () m ()
    left =
            case Pipe i i o () m ()
    left of
                HaveOutput left' :: Pipe i i o () m ()
    left' o :: o
    o -> Pipe i i o () m () -> Pipe o o Void () m r -> Pipe i i Void () m b
    goRight Pipe i i o () m ()
    left' (o -> Pipe o o Void () m r
    rp o
    o)
                NeedInput left' :: i -> Pipe i i o () m ()
    left' lc :: () -> Pipe i i o () m ()
    lc -> (i -> Pipe i i Void () m b)
    -> (() -> Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe i i o () m () -> Pipe i i Void () m b
    recurse (Pipe i i o () m () -> Pipe i i Void () m b)
    -> (i -> Pipe i i o () m ()) -> i -> Pipe i i Void () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe i i o () m ()
    left') (Pipe i i o () m () -> Pipe i i Void () m b
    recurse (Pipe i i o () m () -> Pipe i i Void () m b)
    -> (() -> Pipe i i o () m ()) -> () -> Pipe i i Void () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i i o () m ()
    lc)
                Done () -> Pipe i i o () m () -> Pipe o o Void () m r -> Pipe i i Void () m b
    goRight (() -> Pipe i i o () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done ()) (() -> Pipe o o Void () m r
    rc ())
                PipeM mp :: m (Pipe i i o () m ())
    mp -> m (Pipe i i Void () m b) -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe i i o () m () -> Pipe i i Void () m b)
    -> m (Pipe i i o () m ()) -> m (Pipe i i Void () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe i i o () m () -> Pipe i i Void () m b
    recurse m (Pipe i i o () m ())
    mp)
                Leftover left' :: Pipe i i o () m ()
    left' i :: i
    i -> Pipe i i Void () m b -> i -> Pipe i i Void () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o () m () -> Pipe i i Void () m b
    recurse Pipe i i o () m ()
    left') i
    i -- recurse p
          where
            recurse :: Pipe i i o () m () -> Pipe i i Void () m b
    recurse = (o -> Pipe o o Void () m r)
    -> (() -> Pipe o o Void () m r)
    -> Pipe i i o () m ()
    -> Pipe i i Void () m b
    goLeft o -> Pipe o o Void () m r
    rp () -> Pipe o o Void () m r
    rc
        in Pipe i i o () m () -> Pipe o o Void () m r -> Pipe i i Void () m b
    goRight Pipe i i o () m ()
    left0 ((r -> Pipe o o Void () m r) -> Pipe o o Void () m r
    forall b. (r -> Pipe o o Void () m b) -> Pipe o o Void () m b
    right0 r -> Pipe o o Void () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Merge a @Source@ into a @Conduit@.
    -- The new conduit will stop processing once either source or upstream have been exhausted.
    mergeSource
      :: Monad m
      => Source m i
      -> Conduit a m (i, a)
    mergeSource :: Source m i -> Conduit a m (i, a)
    mergeSource = SealedConduitT () i m () -> Conduit a m (i, a)
    forall (m :: * -> *) i a.
    Monad m =>
    SealedConduitT () i m () -> Conduit a m (i, a)
    loop (SealedConduitT () i m () -> Conduit a m (i, a))
    -> (Source m i -> SealedConduitT () i m ())
    -> Source m i
    -> Conduit a m (i, a)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Source m i -> SealedConduitT () i m ()
    forall i o (m :: * -> *) r.
    ConduitT i o m r -> SealedConduitT i o m r
    sealConduitT
      where
        loop :: Monad m => SealedConduitT () i m () -> Conduit a m (i, a)
        loop :: SealedConduitT () i m () -> Conduit a m (i, a)
    loop src0 :: SealedConduitT () i m ()
    src0 = ConduitT a (i, a) m (Maybe a)
    forall (m :: * -> *) i. Monad m => Consumer i m (Maybe i)
    await ConduitT a (i, a) m (Maybe a)
    -> (Maybe a -> Conduit a m (i, a)) -> Conduit a m (i, a)
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Conduit a m (i, a)
    -> (a -> Conduit a m (i, a)) -> Maybe a -> Conduit a m (i, a)
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe (() -> Conduit a m (i, a)
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()) a -> Conduit a m (i, a)
    go
          where
            go :: a -> Conduit a m (i, a)
    go a :: a
    a = do
              (src1 :: SealedConduitT () i m ()
    src1, mi :: Maybe i
    mi) <- m (SealedConduitT () i m (), Maybe i)
    -> ConduitT a (i, a) m (SealedConduitT () i m (), Maybe i)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m (SealedConduitT () i m (), Maybe i)
     -> ConduitT a (i, a) m (SealedConduitT () i m (), Maybe i))
    -> m (SealedConduitT () i m (), Maybe i)
    -> ConduitT a (i, a) m (SealedConduitT () i m (), Maybe i)
    forall a b. (a -> b) -> a -> b
    $ SealedConduitT () i m ()
    src0 SealedConduitT () i m ()
    -> Sink i m (Maybe i) -> m (SealedConduitT () i m (), Maybe i)
    forall (m :: * -> *) a b.
    Monad m =>
    SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    $$++ Sink i m (Maybe i)
    forall (m :: * -> *) i. Monad m => Consumer i m (Maybe i)
    await
              case Maybe i
    mi of
                Nothing -> () -> Conduit a m (i, a)
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()
                Just i :: i
    i  -> (i, a) -> Conduit a m (i, a)
    forall (m :: * -> *) o i. Monad m => o -> ConduitT i o m ()
    yield (i
    i, a
    a) Conduit a m (i, a) -> Conduit a m (i, a) -> Conduit a m (i, a)
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> SealedConduitT () i m () -> Conduit a m (i, a)
    forall (m :: * -> *) i a.
    Monad m =>
    SealedConduitT () i m () -> Conduit a m (i, a)
    loop SealedConduitT () i m ()
    src1

    -- | Turn a @Sink@ into a @Conduit@ in the following way:
    --
    -- * All input passed to the @Sink@ is yielded downstream.
    --
    -- * When the @Sink@ finishes processing, the result is passed to the provided to the finalizer function.
    --
    -- Note that the @Sink@ will stop receiving input as soon as the downstream it
    -- is connected to shuts down.
    --
    -- An example usage would be to write the result of a @Sink@ to some mutable
    -- variable while allowing other processing to continue.
    --
    -- Since 1.1.0
    passthroughSink :: Monad m
                    => Sink i m r
                    -> (r -> m ()) -- ^ finalizer
                    -> Conduit i m i
    passthroughSink :: Sink i m r -> (r -> m ()) -> Conduit i m i
    passthroughSink (ConduitT sink0 :: forall b. (r -> Pipe i i Void () m b) -> Pipe i i Void () m b
    sink0) final :: r -> m ()
    final = (forall b. (() -> Pipe i i i () m b) -> Pipe i i i () m b)
    -> Conduit i m i
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (() -> Pipe i i i () m b) -> Pipe i i i () m b)
     -> Conduit i m i)
    -> (forall b. (() -> Pipe i i i () m b) -> Pipe i i i () m b)
    -> Conduit i m i
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe i i i () m b
    rest -> let
        -- A bit of explanation is in order, this function is
        -- non-obvious. The purpose of go is to keep track of the sink
        -- we're passing values to, and then yield values downstream. The
        -- third argument to go is the current state of that sink. That's
        -- relatively straightforward.
        --
        -- The second value is the leftover buffer. These are values that
        -- the sink itself has called leftover on, and must be provided
        -- back to the sink the next time it awaits. _However_, these
        -- values should _not_ be reyielded downstream: we have already
        -- yielded them downstream ourself, and it is the responsibility
        -- of the functions wrapping around passthroughSink to handle the
        -- leftovers from downstream.
        --
        -- The trickiest bit is the first argument, which is a solution to
        -- bug https://github.com/snoyberg/conduit/issues/304. The issue
        -- is that, once we get a value, we need to provide it to both the
        -- inner sink _and_ yield it downstream. The obvious thing to do
        -- is yield first and then recursively call go. Unfortunately,
        -- this doesn't work in all cases: if the downstream component
        -- never calls await again, our yield call will never return, and
        -- our sink will not get the last value. This results is confusing
        -- behavior where the sink and downstream component receive a
        -- different number of values.
        --
        -- Solution: keep a buffer of the next value to yield downstream,
        -- and only yield it downstream in one of two cases: our sink is
        -- asking for another value, or our sink is done. This way, we
        -- ensure that, in all cases, we pass exactly the same number of
        -- values to the inner sink as to downstream.

        go :: Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go mbuf :: Maybe i
    mbuf _ (Done r :: r
    r) = do
            Pipe i i i () m ()
    -> (i -> Pipe i i i () m ()) -> Maybe i -> Pipe i i i () m ()
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe (() -> Pipe i i i () m ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()) i -> Pipe i i i () m ()
    forall (m :: * -> *) o l i u. Monad m => o -> Pipe l i o u m ()
    CI.yield Maybe i
    mbuf
            m () -> Pipe i i i () m ()
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m () -> Pipe i i i () m ()) -> m () -> Pipe i i i () m ()
    forall a b. (a -> b) -> a -> b
    $ r -> m ()
    final r
    r
            Conduit i m i -> (() -> Pipe i i i () m b) -> Pipe i i i () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT ((i -> Conduit i m i) -> Conduit i m i
    forall (m :: * -> *) i o r.
    Monad m =>
    (i -> ConduitT i o m r) -> ConduitT i o m ()
    awaitForever i -> Conduit i m i
    forall (m :: * -> *) o i. Monad m => o -> ConduitT i o m ()
    yield) () -> Pipe i i i () m b
    rest
        go mbuf :: Maybe i
    mbuf is :: [i]
    is (Leftover sink :: Pipe i i Void () m r
    sink i :: i
    i) = Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go Maybe i
    mbuf (i
    ii -> [i] -> [i]
    forall a. a -> [a] -> [a]
    :[i]
    is) Pipe i i Void () m r
    sink
        go _ _ (HaveOutput _ o :: Void
    o) = Void -> Pipe i i i () m b
    forall a. Void -> a
    absurd Void
    o
        go mbuf :: Maybe i
    mbuf is :: [i]
    is (PipeM mx :: m (Pipe i i Void () m r)
    mx) = do
            Pipe i i Void () m r
    x <- m (Pipe i i Void () m r) -> Pipe i i i () m (Pipe i i Void () m r)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift m (Pipe i i Void () m r)
    mx
            Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go Maybe i
    mbuf [i]
    is Pipe i i Void () m r
    x
        go mbuf :: Maybe i
    mbuf (i :: i
    i:is :: [i]
    is) (NeedInput next :: i -> Pipe i i Void () m r
    next _) = Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go Maybe i
    mbuf [i]
    is (i -> Pipe i i Void () m r
    next i
    i)
        go mbuf :: Maybe i
    mbuf [] (NeedInput next :: i -> Pipe i i Void () m r
    next done :: () -> Pipe i i Void () m r
    done) = do
            Pipe i i i () m ()
    -> (i -> Pipe i i i () m ()) -> Maybe i -> Pipe i i i () m ()
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe (() -> Pipe i i i () m ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()) i -> Pipe i i i () m ()
    forall (m :: * -> *) o l i u. Monad m => o -> Pipe l i o u m ()
    CI.yield Maybe i
    mbuf
            Maybe i
    mx <- Pipe i i i () m (Maybe i)
    forall l i o u (m :: * -> *). Pipe l i o u m (Maybe i)
    CI.await
            case Maybe i
    mx of
                Nothing -> Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go Maybe i
    forall a. Maybe a
    Nothing [] (() -> Pipe i i Void () m r
    done ())
                Just x :: i
    x -> Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go (i -> Maybe i
    forall a. a -> Maybe a
    Just i
    x) [] (i -> Pipe i i Void () m r
    next i
    x)
        in Maybe i -> [i] -> Pipe i i Void () m r -> Pipe i i i () m b
    go Maybe i
    forall a. Maybe a
    Nothing [] ((r -> Pipe i i Void () m r) -> Pipe i i Void () m r
    forall b. (r -> Pipe i i Void () m b) -> Pipe i i Void () m b
    sink0 r -> Pipe i i Void () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Convert a @Source@ into a list. The basic functionality can be explained as:
    --
    -- > sourceToList src = src $$ Data.Conduit.List.consume
    --
    -- However, @sourceToList@ is able to produce its results lazily, which cannot
    -- be done when running a conduit pipeline in general. Unlike the
    -- @Data.Conduit.Lazy@ module (in conduit-extra), this function performs no
    -- unsafe I\/O operations, and therefore can only be as lazily as the
    -- underlying monad.
    --
    -- Since 1.2.6
    sourceToList :: Monad m => Source m a -> m [a]
    sourceToList :: Source m a -> m [a]
    sourceToList =
        Pipe () () a () m () -> m [a]
    forall (m :: * -> *) l i a r. Monad m => Pipe l i a () m r -> m [a]
    go (Pipe () () a () m () -> m [a])
    -> (Source m a -> Pipe () () a () m ()) -> Source m a -> m [a]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Source m a
     -> (() -> Pipe () () a () m ()) -> Pipe () () a () m ())
    -> (() -> Pipe () () a () m ())
    -> Source m a
    -> Pipe () () a () m ()
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Source m a -> (() -> Pipe () () a () m ()) -> Pipe () () a () m ()
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT () -> Pipe () () a () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done
      where
        go :: Pipe l i a () m r -> m [a]
    go (Done _) = [a] -> m [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return []
        go (HaveOutput src :: Pipe l i a () m r
    src x :: a
    x) = ([a] -> [a]) -> m [a] -> m [a]
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (a
    xa -> [a] -> [a]
    forall a. a -> [a] -> [a]
    :) (Pipe l i a () m r -> m [a]
    go Pipe l i a () m r
    src)
        go (PipeM msrc :: m (Pipe l i a () m r)
    msrc) = m (Pipe l i a () m r)
    msrc m (Pipe l i a () m r) -> (Pipe l i a () m r -> m [a]) -> m [a]
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= Pipe l i a () m r -> m [a]
    go
        go (NeedInput _ c :: () -> Pipe l i a () m r
    c) = Pipe l i a () m r -> m [a]
    go (() -> Pipe l i a () m r
    c ())
        go (Leftover p :: Pipe l i a () m r
    p _) = Pipe l i a () m r -> m [a]
    go Pipe l i a () m r
    p

    -- Define fixity of all our operators
    infixr 0 $$
    infixl 1 $=
    infixr 2 =$
    infixr 2 =$=
    infixr 0 $$+
    infixr 0 $$++
    infixr 0 $$+-
    infixl 1 $=+
    infixr 2 .|

    -- | Equivalent to using 'runConduit' and '.|' together.
    --
    -- Since 1.2.3
    connect :: Monad m
            => ConduitT () a m ()
            -> ConduitT a Void m r
            -> m r
    connect :: ConduitT () a m () -> ConduitT a Void m r -> m r
    connect = ConduitT () a m () -> ConduitT a Void m r -> m r
    forall (m :: * -> *) a b.
    Monad m =>
    Source m a -> Sink a m b -> m b
    ($$)

    -- | Named function synonym for '.|'
    --
    -- Equivalent to '.|' and '=$='. However, the latter is
    -- deprecated and will be removed in a future version.
    --
    -- Since 1.2.3
    fuse :: Monad m => Conduit a m b -> ConduitM b c m r -> ConduitM a c m r
    fuse :: Conduit a m b -> ConduitM b c m r -> ConduitM a c m r
    fuse = Conduit a m b -> ConduitM b c m r -> ConduitM a c m r
    forall (m :: * -> *) a b c r.
    Monad m =>
    Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    (=$=)

    -- | Combine two @Conduit@s together into a new @Conduit@ (aka 'fuse').
    --
    -- Output from the upstream (left) conduit will be fed into the
    -- downstream (right) conduit. Processing will terminate when
    -- downstream (right) returns.
    -- Leftover data returned from the right @Conduit@ will be discarded.
    --
    -- Equivalent to 'fuse' and '=$=', however the latter is deprecated and will
    -- be removed in a future version.
    --
    -- Note that, while this operator looks like categorical composition
    -- (from "Control.Category"), there are a few reasons it's different:
    --
    -- * The position of the type parameters to 'ConduitT' do not
    --   match. We would need to change @ConduitT i o m r@ to @ConduitT r
    --   m i o@, which would preclude a 'Monad' or 'MonadTrans' instance.
    --
    -- * The result value from upstream and downstream are allowed to
    --   differ between upstream and downstream. In other words, we would
    --   need the type signature here to look like @ConduitT a b m r ->
    --   ConduitT b c m r -> ConduitT a c m r@.
    --
    -- * Due to leftovers, we do not have a left identity in Conduit. This
    --   can be achieved with the underlying @Pipe@ datatype, but this is
    --   not generally recommended. See <https://stackoverflow.com/a/15263700>.
    --
    -- @since 1.2.8
    (.|) :: Monad m
         => ConduitM a b m () -- ^ upstream
         -> ConduitM b c m r -- ^ downstream
         -> ConduitM a c m r
    .| :: ConduitM a b m () -> ConduitM b c m r -> ConduitM a c m r
    (.|) = ConduitM a b m () -> ConduitM b c m r -> ConduitM a c m r
    forall (m :: * -> *) a b c r.
    Monad m =>
    Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    fuse
    {-# INLINE (.|) #-}

    -- | The connect operator, which pulls data from a source and pushes to a sink.
    -- If you would like to keep the @Source@ open to be used for other
    -- operations, use the connect-and-resume operator '$$+'.
    --
    -- Since 0.4.0
    ($$) :: Monad m => Source m a -> Sink a m b -> m b
    src :: Source m a
    src $$ :: Source m a -> Sink a m b -> m b
    $$ sink :: Sink a m b
    sink = do
        (rsrc :: SealedConduitT () a m ()
    rsrc, res :: b
    res) <- Source m a
    src Source m a -> Sink a m b -> m (SealedConduitT () a m (), b)
    forall (m :: * -> *) a b.
    Monad m =>
    Source m a -> Sink a m b -> m (SealedConduitT () a m (), b)
    $$+ Sink a m b
    sink
        SealedConduitT () a m ()
    rsrc SealedConduitT () a m () -> Sink a m () -> m ()
    forall (m :: * -> *) a b.
    Monad m =>
    SealedConduitT () a m () -> Sink a m b -> m b
    $$+- () -> Sink a m ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()
        b -> m b
    forall (m :: * -> *) a. Monad m => a -> m a
    return b
    res
    {-# INLINE [1] ($$) #-}
    {-# DEPRECATED ($$) "Use runConduit and .|" #-}

    -- | A synonym for '=$=' for backwards compatibility.
    --
    -- Since 0.4.0
    ($=) :: Monad m => Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    $= :: Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    ($=) = Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    forall (m :: * -> *) a b c r.
    Monad m =>
    Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    (=$=)
    {-# INLINE [0] ($=) #-}
    {-# RULES "conduit: $= is =$=" ($=) = (=$=) #-}
    {-# DEPRECATED ($=) "Use .|" #-}

    -- | A synonym for '=$=' for backwards compatibility.
    --
    -- Since 0.4.0
    (=$) :: Monad m => Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    =$ :: Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    (=$) = Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    forall (m :: * -> *) a b c r.
    Monad m =>
    Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    (=$=)
    {-# INLINE [0] (=$) #-}
    {-# RULES "conduit: =$ is =$=" (=$) = (=$=) #-}
    {-# DEPRECATED (=$) "Use .|" #-}

    -- | Deprecated fusion operator.
    --
    -- Since 0.4.0
    (=$=) :: Monad m => Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    ConduitT left0 :: forall b. (() -> Pipe a a b () m b) -> Pipe a a b () m b
    left0 =$= :: Conduit a m b -> ConduitT b c m r -> ConduitT a c m r
    =$= ConduitT right0 :: forall b. (r -> Pipe b b c () m b) -> Pipe b b c () m b
    right0 = (forall b. (r -> Pipe a a c () m b) -> Pipe a a c () m b)
    -> ConduitT a c m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe a a c () m b) -> Pipe a a c () m b)
     -> ConduitT a c m r)
    -> (forall b. (r -> Pipe a a c () m b) -> Pipe a a c () m b)
    -> ConduitT a c m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe a a c () m b
    rest ->
        let goRight :: Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight left :: Pipe a a b () m ()
    left right :: Pipe b b c () m r
    right =
                case Pipe b b c () m r
    right of
                    HaveOutput p :: Pipe b b c () m r
    p o :: c
    o    -> Pipe a a c () m b -> c -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe b b c () m r -> Pipe a a c () m b
    recurse Pipe b b c () m r
    p) c
    o
                    NeedInput rp :: b -> Pipe b b c () m r
    rp rc :: () -> Pipe b b c () m r
    rc   -> (b -> Pipe b b c () m r)
    -> (() -> Pipe b b c () m r)
    -> Pipe a a b () m ()
    -> Pipe a a c () m b
    goLeft b -> Pipe b b c () m r
    rp () -> Pipe b b c () m r
    rc Pipe a a b () m ()
    left
                    Done r2 :: r
    r2           -> r -> Pipe a a c () m b
    rest r
    r2
                    PipeM mp :: m (Pipe b b c () m r)
    mp          -> m (Pipe a a c () m b) -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe b b c () m r -> Pipe a a c () m b)
    -> m (Pipe b b c () m r) -> m (Pipe a a c () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe b b c () m r -> Pipe a a c () m b
    recurse m (Pipe b b c () m r)
    mp)
                    Leftover right' :: Pipe b b c () m r
    right' i :: b
    i -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight (Pipe a a b () m () -> b -> Pipe a a b () m ()
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput Pipe a a b () m ()
    left b
    i) Pipe b b c () m r
    right'
              where
                recurse :: Pipe b b c () m r -> Pipe a a c () m b
    recurse = Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight Pipe a a b () m ()
    left

            goLeft :: (b -> Pipe b b c () m r)
    -> (() -> Pipe b b c () m r)
    -> Pipe a a b () m ()
    -> Pipe a a c () m b
    goLeft rp :: b -> Pipe b b c () m r
    rp rc :: () -> Pipe b b c () m r
    rc left :: Pipe a a b () m ()
    left =
                case Pipe a a b () m ()
    left of
                    HaveOutput left' :: Pipe a a b () m ()
    left' o :: b
    o        -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight Pipe a a b () m ()
    left' (b -> Pipe b b c () m r
    rp b
    o)
                    NeedInput left' :: a -> Pipe a a b () m ()
    left' lc :: () -> Pipe a a b () m ()
    lc        -> (a -> Pipe a a c () m b)
    -> (() -> Pipe a a c () m b) -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe a a b () m () -> Pipe a a c () m b
    recurse (Pipe a a b () m () -> Pipe a a c () m b)
    -> (a -> Pipe a a b () m ()) -> a -> Pipe a a c () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> Pipe a a b () m ()
    left') (Pipe a a b () m () -> Pipe a a c () m b
    recurse (Pipe a a b () m () -> Pipe a a c () m b)
    -> (() -> Pipe a a b () m ()) -> () -> Pipe a a c () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe a a b () m ()
    lc)
                    Done r1 :: ()
    r1                   -> Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight (() -> Pipe a a b () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done ()
    r1) (() -> Pipe b b c () m r
    rc ()
    r1)
                    PipeM mp :: m (Pipe a a b () m ())
    mp                  -> m (Pipe a a c () m b) -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe a a b () m () -> Pipe a a c () m b)
    -> m (Pipe a a b () m ()) -> m (Pipe a a c () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe a a b () m () -> Pipe a a c () m b
    recurse m (Pipe a a b () m ())
    mp)
                    Leftover left' :: Pipe a a b () m ()
    left' i :: a
    i          -> Pipe a a c () m b -> a -> Pipe a a c () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe a a b () m () -> Pipe a a c () m b
    recurse Pipe a a b () m ()
    left') a
    i
              where
                recurse :: Pipe a a b () m () -> Pipe a a c () m b
    recurse = (b -> Pipe b b c () m r)
    -> (() -> Pipe b b c () m r)
    -> Pipe a a b () m ()
    -> Pipe a a c () m b
    goLeft b -> Pipe b b c () m r
    rp () -> Pipe b b c () m r
    rc
         in Pipe a a b () m () -> Pipe b b c () m r -> Pipe a a c () m b
    goRight ((() -> Pipe a a b () m ()) -> Pipe a a b () m ()
    forall b. (() -> Pipe a a b () m b) -> Pipe a a b () m b
    left0 () -> Pipe a a b () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) ((r -> Pipe b b c () m r) -> Pipe b b c () m r
    forall b. (r -> Pipe b b c () m b) -> Pipe b b c () m b
    right0 r -> Pipe b b c () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)
    {-# INLINE [1] (=$=) #-}
    {-# DEPRECATED (=$=) "Use .|" #-}

    -- | Wait for a single input value from upstream. If no data is available,
    -- returns @Nothing@. Once @await@ returns @Nothing@, subsequent calls will
    -- also return @Nothing@.
    --
    -- Since 0.5.0
    await :: Monad m => Consumer i m (Maybe i)
    await :: Consumer i m (Maybe i)
    await = (forall b. (Maybe i -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m (Maybe i)
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (Maybe i -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m (Maybe i))
    -> (forall b. (Maybe i -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m (Maybe i)
    forall a b. (a -> b) -> a -> b
    $ \f :: Maybe i -> Pipe i i o () m b
    f -> (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Maybe i -> Pipe i i o () m b
    f (Maybe i -> Pipe i i o () m b)
    -> (i -> Maybe i) -> i -> Pipe i i o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Maybe i
    forall a. a -> Maybe a
    Just) (Pipe i i o () m b -> () -> Pipe i i o () m b
    forall a b. a -> b -> a
    const (Pipe i i o () m b -> () -> Pipe i i o () m b)
    -> Pipe i i o () m b -> () -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ Maybe i -> Pipe i i o () m b
    f Maybe i
    forall a. Maybe a
    Nothing)
    {-# INLINE [0] await #-}

    await' :: Monad m
           => ConduitT i o m r
           -> (i -> ConduitT i o m r)
           -> ConduitT i o m r
    await' :: ConduitT i o m r -> (i -> ConduitT i o m r) -> ConduitT i o m r
    await' f :: ConduitT i o m r
    f g :: i -> ConduitT i o m r
    g = (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m r)
    -> (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i i o () m b
    rest -> (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput
        (\i :: i
    i -> ConduitT i o m r -> (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT (i -> ConduitT i o m r
    g i
    i) r -> Pipe i i o () m b
    rest)
        (Pipe i i o () m b -> () -> Pipe i i o () m b
    forall a b. a -> b -> a
    const (Pipe i i o () m b -> () -> Pipe i i o () m b)
    -> Pipe i i o () m b -> () -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ ConduitT i o m r -> (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT ConduitT i o m r
    f r -> Pipe i i o () m b
    rest)
    {-# INLINE await' #-}
    {-# RULES "conduit: await >>= maybe" forall x y. await >>= maybe x y = await' x y #-}

    -- | Send a value downstream to the next component to consume. If the
    -- downstream component terminates, this call will never return control.
    --
    -- Since 0.5.0
    yield :: Monad m
          => o -- ^ output value
          -> ConduitT i o m ()
    yield :: o -> ConduitT i o m ()
    yield o :: o
    o = (forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m ()
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m ())
    -> (forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m ()
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe i i o () m b
    rest -> Pipe i i o () m b -> o -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (() -> Pipe i i o () m b
    rest ()) o
    o
    {-# INLINE yield #-}

    -- | Send a monadic value downstream for the next component to consume.
    --
    -- @since 1.2.7
    yieldM :: Monad m => m o -> ConduitT i o m ()
    yieldM :: m o -> ConduitT i o m ()
    yieldM mo :: m o
    mo = m o -> ConduitT i o m o
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift m o
    mo ConduitT i o m o -> (o -> ConduitT i o m ()) -> ConduitT i o m ()
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= o -> ConduitT i o m ()
    forall (m :: * -> *) o i. Monad m => o -> ConduitT i o m ()
    yield
    {-# INLINE yieldM #-}

      -- FIXME rule won't fire, see FIXME in .Pipe; "mapM_ yield" mapM_ yield = ConduitT . sourceList

    -- | Provide a single piece of leftover input to be consumed by the next
    -- component in the current monadic binding.
    --
    -- /Note/: it is highly encouraged to only return leftover values from input
    -- already consumed from upstream.
    --
    -- @since 0.5.0
    leftover :: i -> ConduitT i o m ()
    leftover :: i -> ConduitT i o m ()
    leftover i :: i
    i = (forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m ()
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m ())
    -> (forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m ()
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe i i o () m b
    rest -> Pipe i i o () m b -> i -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (() -> Pipe i i o () m b
    rest ()) i
    i
    {-# INLINE leftover #-}

    -- | Run a pipeline until processing completes.
    --
    -- Since 1.2.1
    runConduit :: Monad m => ConduitT () Void m r -> m r
    runConduit :: ConduitT () Void m r -> m r
    runConduit (ConduitT p :: forall b. (r -> Pipe () () Void () m b) -> Pipe () () Void () m b
    p) = Pipe Void () Void () m r -> m r
    forall (m :: * -> *) r. Monad m => Pipe Void () Void () m r -> m r
    runPipe (Pipe Void () Void () m r -> m r)
    -> Pipe Void () Void () m r -> m r
    forall a b. (a -> b) -> a -> b
    $ Pipe () () Void () m r -> Pipe Void () Void () m r
    forall (m :: * -> *) i o u r l.
    Monad m =>
    Pipe i i o u m r -> Pipe l i o u m r
    injectLeftovers (Pipe () () Void () m r -> Pipe Void () Void () m r)
    -> Pipe () () Void () m r -> Pipe Void () Void () m r
    forall a b. (a -> b) -> a -> b
    $ (r -> Pipe () () Void () m r) -> Pipe () () Void () m r
    forall b. (r -> Pipe () () Void () m b) -> Pipe () () Void () m b
    p r -> Pipe () () Void () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done
    {-# INLINE [0] runConduit #-}

    -- | Bracket a conduit computation between allocation and release of a
    -- resource. Two guarantees are given about resource finalization:
    --
    -- 1. It will be /prompt/. The finalization will be run as early as possible.
    --
    -- 2. It is exception safe. Due to usage of @resourcet@, the finalization will
    -- be run in the event of any exceptions.
    --
    -- Since 0.5.0
    bracketP :: MonadResource m

             => IO a
                -- ^ computation to run first (\"acquire resource\")
             -> (a -> IO ())
                -- ^ computation to run last (\"release resource\")
             -> (a -> ConduitT i o m r)
                -- ^ computation to run in-between
             -> ConduitT i o m r
                -- returns the value from the in-between computation
    bracketP :: IO a -> (a -> IO ()) -> (a -> ConduitT i o m r) -> ConduitT i o m r
    bracketP alloc :: IO a
    alloc free :: a -> IO ()
    free inside :: a -> ConduitT i o m r
    inside = (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m r)
    -> (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i i o () m b
    rest -> do
      (key :: ReleaseKey
    key, seed :: a
    seed) <- IO a -> (a -> IO ()) -> Pipe i i o () m (ReleaseKey, a)
    forall (m :: * -> *) a.
    MonadResource m =>
    IO a -> (a -> IO ()) -> m (ReleaseKey, a)
    allocate IO a
    alloc a -> IO ()
    free
      ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT (a -> ConduitT i o m r
    inside a
    seed) ((r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall a b. (a -> b) -> a -> b
    $ \res :: r
    res -> do
        ReleaseKey -> Pipe i i o () m ()
    forall (m :: * -> *). MonadIO m => ReleaseKey -> m ()
    release ReleaseKey
    key
        r -> Pipe i i o () m b
    rest r
    res

    -- | Wait for input forever, calling the given inner component for each piece of
    -- new input.
    --
    -- This function is provided as a convenience for the common pattern of
    -- @await@ing input, checking if it's @Just@ and then looping.
    --
    -- Since 0.5.0
    awaitForever :: Monad m => (i -> ConduitT i o m r) -> ConduitT i o m ()
    awaitForever :: (i -> ConduitT i o m r) -> ConduitT i o m ()
    awaitForever f :: i -> ConduitT i o m r
    f = (forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m ()
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
     -> ConduitT i o m ())
    -> (forall b. (() -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m ()
    forall a b. (a -> b) -> a -> b
    $ \rest :: () -> Pipe i i o () m b
    rest ->
        let go :: Pipe i i o () m b
    go = (i -> Pipe i i o () m b)
    -> (() -> Pipe i i o () m b) -> Pipe i i o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i
    i -> ConduitT i o m r -> (r -> Pipe i i o () m b) -> Pipe i i o () m b
    forall i o (m :: * -> *) r.
    ConduitT i o m r
    -> forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    unConduitT (i -> ConduitT i o m r
    f i
    i) (Pipe i i o () m b -> r -> Pipe i i o () m b
    forall a b. a -> b -> a
    const Pipe i i o () m b
    go)) () -> Pipe i i o () m b
    rest
         in Pipe i i o () m b
    go

    -- | Transform the monad that a @ConduitT@ lives in.
    --
    -- Note that the monad transforming function will be run multiple times,
    -- resulting in unintuitive behavior in some cases. For a fuller treatment,
    -- please see:
    --
    -- <https://github.com/snoyberg/conduit/wiki/Dealing-with-monad-transformers>
    --
    -- Since 0.4.0
    transPipe :: Monad m => (forall a. m a -> n a) -> ConduitT i o m r -> ConduitT i o n r
    transPipe :: (forall a. m a -> n a) -> ConduitT i o m r -> ConduitT i o n r
    transPipe f :: forall a. m a -> n a
    f (ConduitT c0 :: forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    c0) = (forall b. (r -> Pipe i i o () n b) -> Pipe i i o () n b)
    -> ConduitT i o n r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i i o () n b) -> Pipe i i o () n b)
     -> ConduitT i o n r)
    -> (forall b. (r -> Pipe i i o () n b) -> Pipe i i o () n b)
    -> ConduitT i o n r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i i o () n b
    rest -> let
            go :: Pipe i i o () m r -> Pipe i i o () n b
    go (HaveOutput p :: Pipe i i o () m r
    p o :: o
    o) = Pipe i i o () n b -> o -> Pipe i i o () n b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i i o () m r -> Pipe i i o () n b
    go Pipe i i o () m r
    p) o
    o
            go (NeedInput p :: i -> Pipe i i o () m r
    p c :: () -> Pipe i i o () m r
    c) = (i -> Pipe i i o () n b)
    -> (() -> Pipe i i o () n b) -> Pipe i i o () n b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe i i o () m r -> Pipe i i o () n b
    go (Pipe i i o () m r -> Pipe i i o () n b)
    -> (i -> Pipe i i o () m r) -> i -> Pipe i i o () n b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe i i o () m r
    p) (Pipe i i o () m r -> Pipe i i o () n b
    go (Pipe i i o () m r -> Pipe i i o () n b)
    -> (() -> Pipe i i o () m r) -> () -> Pipe i i o () n b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i i o () m r
    c)
            go (Done r :: r
    r) = r -> Pipe i i o () n b
    rest r
    r
            go (PipeM mp :: m (Pipe i i o () m r)
    mp) =
                n (Pipe i i o () n b) -> Pipe i i o () n b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i i o () n b) -> n (Pipe i i o () n b)
    forall a. m a -> n a
    f (m (Pipe i i o () n b) -> n (Pipe i i o () n b))
    -> m (Pipe i i o () n b) -> n (Pipe i i o () n b)
    forall a b. (a -> b) -> a -> b
    $ (Pipe i i o () m r -> Pipe i i o () n b)
    -> m (Pipe i i o () m r) -> m (Pipe i i o () n b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe i i o () m r -> Pipe i i o () n b
    go (m (Pipe i i o () m r) -> m (Pipe i i o () n b))
    -> m (Pipe i i o () m r) -> m (Pipe i i o () n b)
    forall a b. (a -> b) -> a -> b
    $ m (Pipe i i o () m r) -> m (Pipe i i o () m r)
    forall (m :: * -> *) l i o u r.
    Monad m =>
    m (Pipe l i o u m r) -> m (Pipe l i o u m r)
    collapse m (Pipe i i o () m r)
    mp)
              where
                -- Combine a series of monadic actions into a single action.  Since we
                -- throw away side effects between different actions, an arbitrary break
                -- between actions will lead to a violation of the monad transformer laws.
                -- Example available at:
                --
                -- http://hpaste.org/75520
                collapse :: m (Pipe l i o u m r) -> m (Pipe l i o u m r)
    collapse mpipe :: m (Pipe l i o u m r)
    mpipe = do
                    Pipe l i o u m r
    pipe' <- m (Pipe l i o u m r)
    mpipe
                    case Pipe l i o u m r
    pipe' of
                        PipeM mpipe' :: m (Pipe l i o u m r)
    mpipe' -> m (Pipe l i o u m r) -> m (Pipe l i o u m r)
    collapse m (Pipe l i o u m r)
    mpipe'
                        _ -> Pipe l i o u m r -> m (Pipe l i o u m r)
    forall (m :: * -> *) a. Monad m => a -> m a
    return Pipe l i o u m r
    pipe'
            go (Leftover p :: Pipe i i o () m r
    p i :: i
    i) = Pipe i i o () n b -> i -> Pipe i i o () n b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o () m r -> Pipe i i o () n b
    go Pipe i i o () m r
    p) i
    i
            in Pipe i i o () m r -> Pipe i i o () n b
    go ((r -> Pipe i i o () m r) -> Pipe i i o () m r
    forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b
    c0 r -> Pipe i i o () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Apply a function to all the output values of a @ConduitT@.
    --
    -- This mimics the behavior of `fmap` for a `Source` and `Conduit` in pre-0.4
    -- days. It can also be simulated by fusing with the @map@ conduit from
    -- "Data.Conduit.List".
    --
    -- Since 0.4.1
    mapOutput :: Monad m => (o1 -> o2) -> ConduitT i o1 m r -> ConduitT i o2 m r
    mapOutput :: (o1 -> o2) -> ConduitT i o1 m r -> ConduitT i o2 m r
    mapOutput f :: o1 -> o2
    f (ConduitT c0 :: forall b. (r -> Pipe i i o1 () m b) -> Pipe i i o1 () m b
    c0) = (forall b. (r -> Pipe i i o2 () m b) -> Pipe i i o2 () m b)
    -> ConduitT i o2 m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i i o2 () m b) -> Pipe i i o2 () m b)
     -> ConduitT i o2 m r)
    -> (forall b. (r -> Pipe i i o2 () m b) -> Pipe i i o2 () m b)
    -> ConduitT i o2 m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i i o2 () m b
    rest -> let
        go :: Pipe i i o1 () m r -> Pipe i i o2 () m b
    go (HaveOutput p :: Pipe i i o1 () m r
    p o :: o1
    o) = Pipe i i o2 () m b -> o2 -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go Pipe i i o1 () m r
    p) (o1 -> o2
    f o1
    o)
        go (NeedInput p :: i -> Pipe i i o1 () m r
    p c :: () -> Pipe i i o1 () m r
    c) = (i -> Pipe i i o2 () m b)
    -> (() -> Pipe i i o2 () m b) -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go (Pipe i i o1 () m r -> Pipe i i o2 () m b)
    -> (i -> Pipe i i o1 () m r) -> i -> Pipe i i o2 () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe i i o1 () m r
    p) (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go (Pipe i i o1 () m r -> Pipe i i o2 () m b)
    -> (() -> Pipe i i o1 () m r) -> () -> Pipe i i o2 () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i i o1 () m r
    c)
        go (Done r :: r
    r) = r -> Pipe i i o2 () m b
    rest r
    r
        go (PipeM mp :: m (Pipe i i o1 () m r)
    mp) = m (Pipe i i o2 () m b) -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe i i o1 () m r -> Pipe i i o2 () m b)
    -> m (Pipe i i o1 () m r) -> m (Pipe i i o2 () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go) m (Pipe i i o1 () m r)
    mp)
        go (Leftover p :: Pipe i i o1 () m r
    p i :: i
    i) = Pipe i i o2 () m b -> i -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go Pipe i i o1 () m r
    p) i
    i
        in Pipe i i o1 () m r -> Pipe i i o2 () m b
    go ((r -> Pipe i i o1 () m r) -> Pipe i i o1 () m r
    forall b. (r -> Pipe i i o1 () m b) -> Pipe i i o1 () m b
    c0 r -> Pipe i i o1 () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Same as 'mapOutput', but use a function that returns @Maybe@ values.
    --
    -- Since 0.5.0
    mapOutputMaybe :: Monad m => (o1 -> Maybe o2) -> ConduitT i o1 m r -> ConduitT i o2 m r
    mapOutputMaybe :: (o1 -> Maybe o2) -> ConduitT i o1 m r -> ConduitT i o2 m r
    mapOutputMaybe f :: o1 -> Maybe o2
    f (ConduitT c0 :: forall b. (r -> Pipe i i o1 () m b) -> Pipe i i o1 () m b
    c0) = (forall b. (r -> Pipe i i o2 () m b) -> Pipe i i o2 () m b)
    -> ConduitT i o2 m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i i o2 () m b) -> Pipe i i o2 () m b)
     -> ConduitT i o2 m r)
    -> (forall b. (r -> Pipe i i o2 () m b) -> Pipe i i o2 () m b)
    -> ConduitT i o2 m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i i o2 () m b
    rest -> let
        go :: Pipe i i o1 () m r -> Pipe i i o2 () m b
    go (HaveOutput p :: Pipe i i o1 () m r
    p o :: o1
    o) = (Pipe i i o2 () m b -> Pipe i i o2 () m b)
    -> (o2 -> Pipe i i o2 () m b -> Pipe i i o2 () m b)
    -> Maybe o2
    -> Pipe i i o2 () m b
    -> Pipe i i o2 () m b
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe Pipe i i o2 () m b -> Pipe i i o2 () m b
    forall a. a -> a
    id (\o' :: o2
    o' p' :: Pipe i i o2 () m b
    p' -> Pipe i i o2 () m b -> o2 -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput Pipe i i o2 () m b
    p' o2
    o') (o1 -> Maybe o2
    f o1
    o) (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go Pipe i i o1 () m r
    p)
        go (NeedInput p :: i -> Pipe i i o1 () m r
    p c :: () -> Pipe i i o1 () m r
    c) = (i -> Pipe i i o2 () m b)
    -> (() -> Pipe i i o2 () m b) -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go (Pipe i i o1 () m r -> Pipe i i o2 () m b)
    -> (i -> Pipe i i o1 () m r) -> i -> Pipe i i o2 () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i -> Pipe i i o1 () m r
    p) (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go (Pipe i i o1 () m r -> Pipe i i o2 () m b)
    -> (() -> Pipe i i o1 () m r) -> () -> Pipe i i o2 () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i i o1 () m r
    c)
        go (Done r :: r
    r) = r -> Pipe i i o2 () m b
    rest r
    r
        go (PipeM mp :: m (Pipe i i o1 () m r)
    mp) = m (Pipe i i o2 () m b) -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM ((Pipe i i o1 () m r -> Pipe i i o2 () m b)
    -> m (Pipe i i o1 () m r) -> m (Pipe i i o2 () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go) m (Pipe i i o1 () m r)
    mp)
        go (Leftover p :: Pipe i i o1 () m r
    p i :: i
    i) = Pipe i i o2 () m b -> i -> Pipe i i o2 () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Pipe i i o1 () m r -> Pipe i i o2 () m b
    go Pipe i i o1 () m r
    p) i
    i
        in Pipe i i o1 () m r -> Pipe i i o2 () m b
    go ((r -> Pipe i i o1 () m r) -> Pipe i i o1 () m r
    forall b. (r -> Pipe i i o1 () m b) -> Pipe i i o1 () m b
    c0 r -> Pipe i i o1 () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Apply a function to all the input values of a @ConduitT@.
    --
    -- Since 0.5.0
    mapInput :: Monad m
             => (i1 -> i2) -- ^ map initial input to new input
             -> (i2 -> Maybe i1) -- ^ map new leftovers to initial leftovers
             -> ConduitT i2 o m r
             -> ConduitT i1 o m r
    mapInput :: (i1 -> i2)
    -> (i2 -> Maybe i1) -> ConduitT i2 o m r -> ConduitT i1 o m r
    mapInput f :: i1 -> i2
    f f' :: i2 -> Maybe i1
    f' (ConduitT c0 :: forall b. (r -> Pipe i2 i2 o () m b) -> Pipe i2 i2 o () m b
    c0) = (forall b. (r -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> ConduitT i1 o m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
     -> ConduitT i1 o m r)
    -> (forall b. (r -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> ConduitT i1 o m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i1 i1 o () m b
    rest -> let
        go :: Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go (HaveOutput p :: Pipe i2 i2 o () m r
    p o :: o
    o) = Pipe i1 i1 o () m b -> o -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go Pipe i2 i2 o () m r
    p) o
    o
        go (NeedInput p :: i2 -> Pipe i2 i2 o () m r
    p c :: () -> Pipe i2 i2 o () m r
    c) = (i1 -> Pipe i1 i1 o () m b)
    -> (() -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b)
    -> (i1 -> Pipe i2 i2 o () m r) -> i1 -> Pipe i1 i1 o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i2 -> Pipe i2 i2 o () m r
    p (i2 -> Pipe i2 i2 o () m r)
    -> (i1 -> i2) -> i1 -> Pipe i2 i2 o () m r
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i1 -> i2
    f) (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b)
    -> (() -> Pipe i2 i2 o () m r) -> () -> Pipe i1 i1 o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i2 i2 o () m r
    c)
        go (Done r :: r
    r) = r -> Pipe i1 i1 o () m b
    rest r
    r
        go (PipeM mp :: m (Pipe i2 i2 o () m r)
    mp) = m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall a b. (a -> b) -> a -> b
    $ (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b)
    -> m (Pipe i2 i2 o () m r) -> m (Pipe i1 i1 o () m b)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go m (Pipe i2 i2 o () m r)
    mp
        go (Leftover p :: Pipe i2 i2 o () m r
    p i :: i2
    i) = (Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b)
    -> (i1 -> Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b)
    -> Maybe i1
    -> Pipe i1 i1 o () m b
    -> Pipe i1 i1 o () m b
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b
    forall a. a -> a
    id ((Pipe i1 i1 o () m b -> i1 -> Pipe i1 i1 o () m b)
    -> i1 -> Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Pipe i1 i1 o () m b -> i1 -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover) (i2 -> Maybe i1
    f' i2
    i) (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go Pipe i2 i2 o () m r
    p)
        in Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go ((r -> Pipe i2 i2 o () m r) -> Pipe i2 i2 o () m r
    forall b. (r -> Pipe i2 i2 o () m b) -> Pipe i2 i2 o () m b
    c0 r -> Pipe i2 i2 o () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Apply a monadic action to all the input values of a @ConduitT@.
    --
    -- Since 1.3.2
    mapInputM :: Monad m
              => (i1 -> m i2) -- ^ map initial input to new input
              -> (i2 -> m (Maybe i1)) -- ^ map new leftovers to initial leftovers
              -> ConduitT i2 o m r
              -> ConduitT i1 o m r
    mapInputM :: (i1 -> m i2)
    -> (i2 -> m (Maybe i1)) -> ConduitT i2 o m r -> ConduitT i1 o m r
    mapInputM f :: i1 -> m i2
    f f' :: i2 -> m (Maybe i1)
    f' (ConduitT c0 :: forall b. (r -> Pipe i2 i2 o () m b) -> Pipe i2 i2 o () m b
    c0) = (forall b. (r -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> ConduitT i1 o m r
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT ((forall b. (r -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
     -> ConduitT i1 o m r)
    -> (forall b. (r -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> ConduitT i1 o m r
    forall a b. (a -> b) -> a -> b
    $ \rest :: r -> Pipe i1 i1 o () m b
    rest -> let
        go :: Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go (HaveOutput p :: Pipe i2 i2 o () m r
    p o :: o
    o) = Pipe i1 i1 o () m b -> o -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go Pipe i2 i2 o () m r
    p) o
    o
        go (NeedInput p :: i2 -> Pipe i2 i2 o () m r
    p c :: () -> Pipe i2 i2 o () m r
    c)  = (i1 -> Pipe i1 i1 o () m b)
    -> (() -> Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput (\i :: i1
    i -> m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall a b. (a -> b) -> a -> b
    $ Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b)
    -> (i2 -> Pipe i2 i2 o () m r) -> i2 -> Pipe i1 i1 o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . i2 -> Pipe i2 i2 o () m r
    p (i2 -> Pipe i1 i1 o () m b) -> m i2 -> m (Pipe i1 i1 o () m b)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> i1 -> m i2
    f i1
    i) (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b)
    -> (() -> Pipe i2 i2 o () m r) -> () -> Pipe i1 i1 o () m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . () -> Pipe i2 i2 o () m r
    c)
        go (Done r :: r
    r)         = r -> Pipe i1 i1 o () m b
    rest r
    r
        go (PipeM mp :: m (Pipe i2 i2 o () m r)
    mp)       = m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall a b. (a -> b) -> a -> b
    $ (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b)
    -> m (Pipe i2 i2 o () m r) -> m (Pipe i1 i1 o () m b)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go m (Pipe i2 i2 o () m r)
    mp
        go (Leftover p :: Pipe i2 i2 o () m r
    p i :: i2
    i)   = m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b)
    -> m (Pipe i1 i1 o () m b) -> Pipe i1 i1 o () m b
    forall a b. (a -> b) -> a -> b
    $ (\x :: Maybe i1
    x -> (Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b)
    -> (i1 -> Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b)
    -> Maybe i1
    -> Pipe i1 i1 o () m b
    -> Pipe i1 i1 o () m b
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b
    forall a. a -> a
    id ((Pipe i1 i1 o () m b -> i1 -> Pipe i1 i1 o () m b)
    -> i1 -> Pipe i1 i1 o () m b -> Pipe i1 i1 o () m b
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Pipe i1 i1 o () m b -> i1 -> Pipe i1 i1 o () m b
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover) Maybe i1
    x (Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go Pipe i2 i2 o () m r
    p)) (Maybe i1 -> Pipe i1 i1 o () m b)
    -> m (Maybe i1) -> m (Pipe i1 i1 o () m b)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> i2 -> m (Maybe i1)
    f' i2
    i
        in Pipe i2 i2 o () m r -> Pipe i1 i1 o () m b
    go ((r -> Pipe i2 i2 o () m r) -> Pipe i2 i2 o () m r
    forall b. (r -> Pipe i2 i2 o () m b) -> Pipe i2 i2 o () m b
    c0 r -> Pipe i2 i2 o () m r
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | The connect-and-resume operator. This does not close the @Source@, but
    -- instead returns it to be used again. This allows a @Source@ to be used
    -- incrementally in a large program, without forcing the entire program to live
    -- in the @Sink@ monad.
    --
    -- Mnemonic: connect + do more.
    --
    -- Since 0.5.0
    ($$+) :: Monad m => Source m a -> Sink a m b -> m (SealedConduitT () a m (), b)
    src :: Source m a
    src $$+ :: Source m a -> Sink a m b -> m (SealedConduitT () a m (), b)
    $$+ sink :: Sink a m b
    sink = SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    forall (m :: * -> *) a b.
    Monad m =>
    SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    connectResume (Source m a -> SealedConduitT () a m ()
    forall i o (m :: * -> *) r.
    ConduitT i o m r -> SealedConduitT i o m r
    sealConduitT Source m a
    src) Sink a m b
    sink
    {-# INLINE ($$+) #-}

    -- | Continue processing after usage of @$$+@.
    --
    -- Since 0.5.0
    ($$++) :: Monad m => SealedConduitT () a m () -> Sink a m b -> m (SealedConduitT () a m (), b)
    $$++ :: SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    ($$++) = SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    forall (m :: * -> *) a b.
    Monad m =>
    SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    connectResume
    {-# INLINE ($$++) #-}

    -- | Same as @$$++@ and @connectResume@, but doesn't include the
    -- updated @SealedConduitT@.
    --
    -- /NOTE/ In previous versions, this would cause finalizers to
    -- run. Since version 1.3.0, there are no finalizers in conduit.
    --
    -- Since 0.5.0
    ($$+-) :: Monad m => SealedConduitT () a m () -> Sink a m b -> m b
    rsrc :: SealedConduitT () a m ()
    rsrc $$+- :: SealedConduitT () a m () -> Sink a m b -> m b
    $$+- sink :: Sink a m b
    sink = do
        (_, res :: b
    res) <- SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    forall (m :: * -> *) a b.
    Monad m =>
    SealedConduitT () a m ()
    -> Sink a m b -> m (SealedConduitT () a m (), b)
    connectResume SealedConduitT () a m ()
    rsrc Sink a m b
    sink
        b -> m b
    forall (m :: * -> *) a. Monad m => a -> m a
    return b
    res
    {-# INLINE ($$+-) #-}

    -- | Left fusion for a sealed source.
    --
    -- Since 1.0.16
    ($=+) :: Monad m => SealedConduitT () a m () -> Conduit a m b -> SealedConduitT () b m ()
    SealedConduitT src :: Pipe () () a () m ()
    src $=+ :: SealedConduitT () a m ()
    -> Conduit a m b -> SealedConduitT () b m ()
    $=+ ConduitT sink :: forall b. (() -> Pipe a a b () m b) -> Pipe a a b () m b
    sink = Pipe () () b () m () -> SealedConduitT () b m ()
    forall i o (m :: * -> *) r.
    Pipe i i o () m r -> SealedConduitT i o m r
    SealedConduitT (Pipe () () a () m ()
    src Pipe () () a () m () -> Pipe a a b () m () -> Pipe () () b () m ()
    forall (m :: * -> *) l a b r0 r1 c r2.
    Monad m =>
    Pipe l a b r0 m r1 -> Pipe b b c r1 m r2 -> Pipe l a c r0 m r2
    `pipeL` (() -> Pipe a a b () m ()) -> Pipe a a b () m ()
    forall b. (() -> Pipe a a b () m b) -> Pipe a a b () m b
    sink () -> Pipe a a b () m ()
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done)

    -- | Provide for a stream of data that can be flushed.
    --
    -- A number of @Conduit@s (e.g., zlib compression) need the ability to flush
    -- the stream at some point. This provides a single wrapper datatype to be used
    -- in all such circumstances.
    --
    -- Since 0.3.0
    data Flush a = Chunk a | Flush
        deriving (Int -> Flush a -> ShowS
    [Flush a] -> ShowS
    Flush a -> String
    (Int -> Flush a -> ShowS)
    -> (Flush a -> String) -> ([Flush a] -> ShowS) -> Show (Flush a)
    forall a. Show a => Int -> Flush a -> ShowS
    forall a. Show a => [Flush a] -> ShowS
    forall a. Show a => Flush a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [Flush a] -> ShowS
    $cshowList :: forall a. Show a => [Flush a] -> ShowS
    show :: Flush a -> String
    $cshow :: forall a. Show a => Flush a -> String
    showsPrec :: Int -> Flush a -> ShowS
    $cshowsPrec :: forall a. Show a => Int -> Flush a -> ShowS
    Show, Flush a -> Flush a -> Bool
    (Flush a -> Flush a -> Bool)
    -> (Flush a -> Flush a -> Bool) -> Eq (Flush a)
    forall a. Eq a => Flush a -> Flush a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: Flush a -> Flush a -> Bool
    $c/= :: forall a. Eq a => Flush a -> Flush a -> Bool
    == :: Flush a -> Flush a -> Bool
    $c== :: forall a. Eq a => Flush a -> Flush a -> Bool
    Eq, Eq (Flush a)
    Eq (Flush a) =>
    (Flush a -> Flush a -> Ordering)
    -> (Flush a -> Flush a -> Bool)
    -> (Flush a -> Flush a -> Bool)
    -> (Flush a -> Flush a -> Bool)
    -> (Flush a -> Flush a -> Bool)
    -> (Flush a -> Flush a -> Flush a)
    -> (Flush a -> Flush a -> Flush a)
    -> Ord (Flush a)
    Flush a -> Flush a -> Bool
    Flush a -> Flush a -> Ordering
    Flush a -> Flush a -> Flush a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Flush a)
    forall a. Ord a => Flush a -> Flush a -> Bool
    forall a. Ord a => Flush a -> Flush a -> Ordering
    forall a. Ord a => Flush a -> Flush a -> Flush a
    min :: Flush a -> Flush a -> Flush a
    $cmin :: forall a. Ord a => Flush a -> Flush a -> Flush a
    max :: Flush a -> Flush a -> Flush a
    $cmax :: forall a. Ord a => Flush a -> Flush a -> Flush a
    >= :: Flush a -> Flush a -> Bool
    $c>= :: forall a. Ord a => Flush a -> Flush a -> Bool
    > :: Flush a -> Flush a -> Bool
    $c> :: forall a. Ord a => Flush a -> Flush a -> Bool
    <= :: Flush a -> Flush a -> Bool
    $c<= :: forall a. Ord a => Flush a -> Flush a -> Bool
    < :: Flush a -> Flush a -> Bool
    $c< :: forall a. Ord a => Flush a -> Flush a -> Bool
    compare :: Flush a -> Flush a -> Ordering
    $ccompare :: forall a. Ord a => Flush a -> Flush a -> Ordering
    $cp1Ord :: forall a. Ord a => Eq (Flush a)
    Ord)
    instance Functor Flush where
        fmap :: (a -> b) -> Flush a -> Flush b
    fmap _ Flush = Flush b
    forall a. Flush a
    Flush
        fmap f :: a -> b
    f (Chunk a :: a
    a) = b -> Flush b
    forall a. a -> Flush a
    Chunk (a -> b
    f a
    a)

    -- | A wrapper for defining an 'Applicative' instance for 'Source's which allows
    -- to combine sources together, generalizing 'zipSources'. A combined source
    -- will take input yielded from each of its @Source@s until any of them stop
    -- producing output.
    --
    -- Since 1.0.13
    newtype ZipSource m o = ZipSource { ZipSource m o -> Source m o
    getZipSource :: Source m o }

    instance Monad m => Functor (ZipSource m) where
        fmap :: (a -> b) -> ZipSource m a -> ZipSource m b
    fmap f :: a -> b
    f = Source m b -> ZipSource m b
    forall (m :: * -> *) o. Source m o -> ZipSource m o
    ZipSource (Source m b -> ZipSource m b)
    -> (ZipSource m a -> Source m b) -> ZipSource m a -> ZipSource m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (a -> b) -> ConduitT () a m () -> Source m b
    forall (m :: * -> *) o1 o2 i r.
    Monad m =>
    (o1 -> o2) -> ConduitT i o1 m r -> ConduitT i o2 m r
    mapOutput a -> b
    f (ConduitT () a m () -> Source m b)
    -> (ZipSource m a -> ConduitT () a m ())
    -> ZipSource m a
    -> Source m b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ZipSource m a -> ConduitT () a m ()
    forall (m :: * -> *) o. ZipSource m o -> Source m o
    getZipSource
    instance Monad m => Applicative (ZipSource m) where
        pure :: a -> ZipSource m a
    pure  = Source m a -> ZipSource m a
    forall (m :: * -> *) o. Source m o -> ZipSource m o
    ZipSource (Source m a -> ZipSource m a)
    -> (a -> Source m a) -> a -> ZipSource m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Source m a -> Source m a
    forall (f :: * -> *) a b. Applicative f => f a -> f b
    forever (Source m a -> Source m a) -> (a -> Source m a) -> a -> Source m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> Source m a
    forall (m :: * -> *) o i. Monad m => o -> ConduitT i o m ()
    yield
        (ZipSource f :: Source m (a -> b)
    f) <*> :: ZipSource m (a -> b) -> ZipSource m a -> ZipSource m b
    <*> (ZipSource x :: Source m a
    x) = Source m b -> ZipSource m b
    forall (m :: * -> *) o. Source m o -> ZipSource m o
    ZipSource (Source m b -> ZipSource m b) -> Source m b -> ZipSource m b
    forall a b. (a -> b) -> a -> b
    $ Source m (a -> b) -> Source m a -> Source m b
    forall (m :: * -> *) a b.
    Monad m =>
    Source m (a -> b) -> Source m a -> Source m b
    zipSourcesApp Source m (a -> b)
    f Source m a
    x

    -- | Coalesce all values yielded by all of the @Source@s.
    --
    -- Implemented on top of @ZipSource@ and as such, it exhibits the same
    -- short-circuiting behavior as @ZipSource@. See that data type for more
    -- details. If you want to create a source that yields *all* values from
    -- multiple sources, use `sequence_`.
    --
    -- Since 1.0.13
    sequenceSources :: (Traversable f, Monad m) => f (Source m o) -> Source m (f o)
    sequenceSources :: f (Source m o) -> Source m (f o)
    sequenceSources = ZipSource m (f o) -> Source m (f o)
    forall (m :: * -> *) o. ZipSource m o -> Source m o
    getZipSource (ZipSource m (f o) -> Source m (f o))
    -> (f (Source m o) -> ZipSource m (f o))
    -> f (Source m o)
    -> Source m (f o)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . f (ZipSource m o) -> ZipSource m (f o)
    forall (t :: * -> *) (f :: * -> *) a.
    (Traversable t, Applicative f) =>
    t (f a) -> f (t a)
    sequenceA (f (ZipSource m o) -> ZipSource m (f o))
    -> (f (Source m o) -> f (ZipSource m o))
    -> f (Source m o)
    -> ZipSource m (f o)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Source m o -> ZipSource m o)
    -> f (Source m o) -> f (ZipSource m o)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Source m o -> ZipSource m o
    forall (m :: * -> *) o. Source m o -> ZipSource m o
    ZipSource

    -- | A wrapper for defining an 'Applicative' instance for 'Sink's which allows
    -- to combine sinks together, generalizing 'zipSinks'. A combined sink
    -- distributes the input to all its participants and when all finish, produces
    -- the result. This allows to define functions like
    --
    -- @
    -- sequenceSinks :: (Monad m)
    --           => [Sink i m r] -> Sink i m [r]
    -- sequenceSinks = getZipSink . sequenceA . fmap ZipSink
    -- @
    --
    -- Note that the standard 'Applicative' instance for conduits works
    -- differently. It feeds one sink with input until it finishes, then switches
    -- to another, etc., and at the end combines their results.
    --
    -- This newtype is in fact a type constrained version of 'ZipConduit', and has
    -- the same behavior. It's presented as a separate type since (1) it
    -- historically predates @ZipConduit@, and (2) the type constraining can make
    -- your code clearer (and thereby make your error messages more easily
    -- understood).
    --
    -- Since 1.0.13
    newtype ZipSink i m r = ZipSink { ZipSink i m r -> Sink i m r
    getZipSink :: Sink i m r }

    instance Monad m => Functor (ZipSink i m) where
        fmap :: (a -> b) -> ZipSink i m a -> ZipSink i m b
    fmap f :: a -> b
    f (ZipSink x :: Sink i m a
    x) = Sink i m b -> ZipSink i m b
    forall i (m :: * -> *) r. Sink i m r -> ZipSink i m r
    ZipSink ((a -> b) -> Sink i m a -> Sink i m b
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM a -> b
    f Sink i m a
    x)
    instance Monad m => Applicative (ZipSink i m) where
        pure :: a -> ZipSink i m a
    pure  = Sink i m a -> ZipSink i m a
    forall i (m :: * -> *) r. Sink i m r -> ZipSink i m r
    ZipSink (Sink i m a -> ZipSink i m a)
    -> (a -> Sink i m a) -> a -> ZipSink i m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> Sink i m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return
        (ZipSink f :: Sink i m (a -> b)
    f) <*> :: ZipSink i m (a -> b) -> ZipSink i m a -> ZipSink i m b
    <*> (ZipSink x :: Sink i m a
    x) =
             Sink i m b -> ZipSink i m b
    forall i (m :: * -> *) r. Sink i m r -> ZipSink i m r
    ZipSink (Sink i m b -> ZipSink i m b) -> Sink i m b -> ZipSink i m b
    forall a b. (a -> b) -> a -> b
    $ ((a -> b, a) -> b) -> ConduitT i Void m (a -> b, a) -> Sink i m b
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (((a -> b) -> a -> b) -> (a -> b, a) -> b
    forall a b c. (a -> b -> c) -> (a, b) -> c
    uncurry (a -> b) -> a -> b
    forall a b. (a -> b) -> a -> b
    ($)) (ConduitT i Void m (a -> b, a) -> Sink i m b)
    -> ConduitT i Void m (a -> b, a) -> Sink i m b
    forall a b. (a -> b) -> a -> b
    $ Sink i m (a -> b) -> Sink i m a -> ConduitT i Void m (a -> b, a)
    forall (m :: * -> *) i r r'.
    Monad m =>
    Sink i m r -> Sink i m r' -> Sink i m (r, r')
    zipSinks Sink i m (a -> b)
    f Sink i m a
    x

    -- | Send incoming values to all of the @Sink@ providing, and ultimately
    -- coalesce together all return values.
    --
    -- Implemented on top of @ZipSink@, see that data type for more details.
    --
    -- Since 1.0.13
    sequenceSinks :: (Traversable f, Monad m) => f (Sink i m r) -> Sink i m (f r)
    sequenceSinks :: f (Sink i m r) -> Sink i m (f r)
    sequenceSinks = ZipSink i m (f r) -> Sink i m (f r)
    forall i (m :: * -> *) r. ZipSink i m r -> Sink i m r
    getZipSink (ZipSink i m (f r) -> Sink i m (f r))
    -> (f (Sink i m r) -> ZipSink i m (f r))
    -> f (Sink i m r)
    -> Sink i m (f r)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . f (ZipSink i m r) -> ZipSink i m (f r)
    forall (t :: * -> *) (f :: * -> *) a.
    (Traversable t, Applicative f) =>
    t (f a) -> f (t a)
    sequenceA (f (ZipSink i m r) -> ZipSink i m (f r))
    -> (f (Sink i m r) -> f (ZipSink i m r))
    -> f (Sink i m r)
    -> ZipSink i m (f r)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Sink i m r -> ZipSink i m r)
    -> f (Sink i m r) -> f (ZipSink i m r)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Sink i m r -> ZipSink i m r
    forall i (m :: * -> *) r. Sink i m r -> ZipSink i m r
    ZipSink

    -- | The connect-and-resume operator. This does not close the @Conduit@, but
    -- instead returns it to be used again. This allows a @Conduit@ to be used
    -- incrementally in a large program, without forcing the entire program to live
    -- in the @Sink@ monad.
    --
    -- Leftover data returned from the @Sink@ will be discarded.
    --
    -- Mnemonic: connect + do more.
    --
    -- Since 1.0.17
    (=$$+) :: Monad m
           => ConduitT a b m ()
           -> ConduitT b Void m r
           -> ConduitT a Void m (SealedConduitT a b m (), r)
    =$$+ :: ConduitT a b m ()
    -> ConduitT b Void m r
    -> ConduitT a Void m (SealedConduitT a b m (), r)
    (=$$+) conduit :: ConduitT a b m ()
    conduit = SealedConduitT a b m ()
    -> ConduitT b Void m r
    -> ConduitT a Void m (SealedConduitT a b m (), r)
    forall (m :: * -> *) i o r.
    Monad m =>
    SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    connectResumeConduit (ConduitT a b m () -> SealedConduitT a b m ()
    forall i o (m :: * -> *) r.
    ConduitT i o m r -> SealedConduitT i o m r
    sealConduitT ConduitT a b m ()
    conduit)
    {-# INLINE (=$$+) #-}

    -- | Continue processing after usage of '=$$+'. Connect a 'SealedConduitT' to
    -- a sink and return the output of the sink together with a new
    -- 'SealedConduitT'.
    --
    -- Since 1.0.17
    (=$$++) :: Monad m => SealedConduitT i o m () -> ConduitT o Void m r -> ConduitT i Void m (SealedConduitT i o m (), r)
    =$$++ :: SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    (=$$++) = SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    forall (m :: * -> *) i o r.
    Monad m =>
    SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    connectResumeConduit
    {-# INLINE (=$$++) #-}

    -- | Same as @=$$++@, but doesn't include the updated
    -- @SealedConduitT@.
    --
    -- /NOTE/ In previous versions, this would cause finalizers to
    -- run. Since version 1.3.0, there are no finalizers in conduit.
    --
    -- Since 1.0.17
    (=$$+-) :: Monad m => SealedConduitT i o m () -> ConduitT o Void m r -> ConduitT i Void m r
    rsrc :: SealedConduitT i o m ()
    rsrc =$$+- :: SealedConduitT i o m ()
    -> ConduitT o Void m r -> ConduitT i Void m r
    =$$+- sink :: ConduitT o Void m r
    sink = do
        (_, res :: r
    res) <- SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    forall (m :: * -> *) i o r.
    Monad m =>
    SealedConduitT i o m ()
    -> ConduitT o Void m r
    -> ConduitT i Void m (SealedConduitT i o m (), r)
    connectResumeConduit SealedConduitT i o m ()
    rsrc ConduitT o Void m r
    sink
        r -> ConduitT i Void m r
    forall (m :: * -> *) a. Monad m => a -> m a
    return r
    res
    {-# INLINE (=$$+-) #-}

    infixr 0 =$$+
    infixr 0 =$$++
    infixr 0 =$$+-

    -- | Provides an alternative @Applicative@ instance for @ConduitT@. In this instance,
    -- every incoming value is provided to all @ConduitT@s, and output is coalesced together.
    -- Leftovers from individual @ConduitT@s 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
    newtype ZipConduit i o m r = ZipConduit { ZipConduit i o m r -> ConduitT i o m r
    getZipConduit :: ConduitT i o m r }
        deriving a -> ZipConduit i o m b -> ZipConduit i o m a
    (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b
    (forall a b. (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b)
    -> (forall a b. a -> ZipConduit i o m b -> ZipConduit i o m a)
    -> Functor (ZipConduit i o m)
    forall a b. a -> ZipConduit i o m b -> ZipConduit i o m a
    forall a b. (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b
    forall i o (m :: * -> *) a b.
    a -> ZipConduit i o m b -> ZipConduit i o m a
    forall i o (m :: * -> *) a b.
    (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    <$ :: a -> ZipConduit i o m b -> ZipConduit i o m a
    $c<$ :: forall i o (m :: * -> *) a b.
    a -> ZipConduit i o m b -> ZipConduit i o m a
    fmap :: (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b
    $cfmap :: forall i o (m :: * -> *) a b.
    (a -> b) -> ZipConduit i o m a -> ZipConduit i o m b
    Functor
    instance Monad m => Applicative (ZipConduit i o m) where
        pure :: a -> ZipConduit i o m a
    pure = ConduitT i o m a -> ZipConduit i o m a
    forall i o (m :: * -> *) r. ConduitT i o m r -> ZipConduit i o m r
    ZipConduit (ConduitT i o m a -> ZipConduit i o m a)
    -> (a -> ConduitT i o m a) -> a -> ZipConduit i o m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . a -> ConduitT i o m a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure
        ZipConduit left :: ConduitT i o m (a -> b)
    left <*> :: ZipConduit i o m (a -> b)
    -> ZipConduit i o m a -> ZipConduit i o m b
    <*> ZipConduit right :: ConduitT i o m a
    right = ConduitT i o m b -> ZipConduit i o m b
    forall i o (m :: * -> *) r. ConduitT i o m r -> ZipConduit i o m r
    ZipConduit (ConduitT i o m (a -> b) -> ConduitT i o m a -> ConduitT i o m b
    forall (m :: * -> *) i o x y.
    Monad m =>
    ConduitT i o m (x -> y) -> ConduitT i o m x -> ConduitT i o m y
    zipConduitApp ConduitT i o m (a -> b)
    left ConduitT i o m a
    right)

    -- | Provide identical input to all of the @Conduit@s and combine their outputs
    -- into a single stream.
    --
    -- Implemented on top of @ZipConduit@, see that data type for more details.
    --
    -- Since 1.0.17
    sequenceConduits :: (Traversable f, Monad m) => f (ConduitT i o m r) -> ConduitT i o m (f r)
    sequenceConduits :: f (ConduitT i o m r) -> ConduitT i o m (f r)
    sequenceConduits = ZipConduit i o m (f r) -> ConduitT i o m (f r)
    forall i o (m :: * -> *) r. ZipConduit i o m r -> ConduitT i o m r
    getZipConduit (ZipConduit i o m (f r) -> ConduitT i o m (f r))
    -> (f (ConduitT i o m r) -> ZipConduit i o m (f r))
    -> f (ConduitT i o m r)
    -> ConduitT i o m (f r)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . f (ZipConduit i o m r) -> ZipConduit i o m (f r)
    forall (t :: * -> *) (f :: * -> *) a.
    (Traversable t, Applicative f) =>
    t (f a) -> f (t a)
    sequenceA (f (ZipConduit i o m r) -> ZipConduit i o m (f r))
    -> (f (ConduitT i o m r) -> f (ZipConduit i o m r))
    -> f (ConduitT i o m r)
    -> ZipConduit i o m (f r)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ConduitT i o m r -> ZipConduit i o m r)
    -> f (ConduitT i o m r) -> f (ZipConduit i o m r)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ConduitT i o m r -> ZipConduit i o m r
    forall i o (m :: * -> *) r. ConduitT i o m r -> ZipConduit i o m r
    ZipConduit

    -- | Fuse two @ConduitT@s together, and provide the return value of both. Note
    -- that this will force the entire upstream @ConduitT@ to be run to produce the
    -- result value, even if the downstream terminates early.
    --
    -- Since 1.1.5
    fuseBoth :: Monad m => ConduitT a b m r1 -> ConduitT b c m r2 -> ConduitT a c m (r1, r2)
    fuseBoth :: ConduitT a b m r1 -> ConduitT b c m r2 -> ConduitT a c m (r1, r2)
    fuseBoth (ConduitT up :: forall b. (r1 -> Pipe a a b () m b) -> Pipe a a b () m b
    up) (ConduitT down :: forall b. (r2 -> Pipe b b c () m b) -> Pipe b b c () m b
    down) =
        (forall b. ((r1, r2) -> Pipe a a c () m b) -> Pipe a a c () m b)
    -> ConduitT a c m (r1, r2)
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT (Pipe a a b () m r1
    -> Pipe b b c r1 m (r1, r2) -> Pipe a a c () m (r1, r2)
    forall (m :: * -> *) l a b r0 r1 c r2.
    Monad m =>
    Pipe l a b r0 m r1 -> Pipe b b c r1 m r2 -> Pipe l a c r0 m r2
    pipeL ((r1 -> Pipe a a b () m r1) -> Pipe a a b () m r1
    forall b. (r1 -> Pipe a a b () m b) -> Pipe a a b () m b
    up r1 -> Pipe a a b () m r1
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) (Pipe b b c r1 m r2 -> Pipe b b c r1 m (r1, r2)
    forall (m :: * -> *) l i o u r.
    Monad m =>
    Pipe l i o u m r -> Pipe l i o u m (u, r)
    withUpstream (Pipe b b c r1 m r2 -> Pipe b b c r1 m (r1, r2))
    -> Pipe b b c r1 m r2 -> Pipe b b c r1 m (r1, r2)
    forall a b. (a -> b) -> a -> b
    $ Pipe b b c () m r2 -> Pipe b b c r1 m r2
    forall (m :: * -> *) l i o r u.
    Monad m =>
    Pipe l i o () m r -> Pipe l i o u m r
    generalizeUpstream (Pipe b b c () m r2 -> Pipe b b c r1 m r2)
    -> Pipe b b c () m r2 -> Pipe b b c r1 m r2
    forall a b. (a -> b) -> a -> b
    $ (r2 -> Pipe b b c () m r2) -> Pipe b b c () m r2
    forall b. (r2 -> Pipe b b c () m b) -> Pipe b b c () m b
    down r2 -> Pipe b b c () m r2
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) Pipe a a c () m (r1, r2)
    -> ((r1, r2) -> Pipe a a c () m b) -> Pipe a a c () m b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>=)
    {-# INLINE fuseBoth #-}

    -- | Like 'fuseBoth', but does not force consumption of the @Producer@.
    -- In the case that the @Producer@ terminates, the result value is
    -- provided as a @Just@ value. If it does not terminate, then a
    -- @Nothing@ value is returned.
    --
    -- One thing to note here is that "termination" here only occurs if the
    -- @Producer@ actually yields a @Nothing@ value. For example, with the
    -- @Producer@ @mapM_ yield [1..5]@, if five values are requested, the
    -- @Producer@ has not yet terminated. Termination only occurs when the
    -- sixth value is awaited for and the @Producer@ signals termination.
    --
    -- Since 1.2.4
    fuseBothMaybe
        :: Monad m
        => ConduitT a b m r1
        -> ConduitT b c m r2
        -> ConduitT a c m (Maybe r1, r2)
    fuseBothMaybe :: ConduitT a b m r1
    -> ConduitT b c m r2 -> ConduitT a c m (Maybe r1, r2)
    fuseBothMaybe (ConduitT up :: forall b. (r1 -> Pipe a a b () m b) -> Pipe a a b () m b
    up) (ConduitT down :: forall b. (r2 -> Pipe b b c () m b) -> Pipe b b c () m b
    down) =
        (forall b.
     ((Maybe r1, r2) -> Pipe a a c () m b) -> Pipe a a c () m b)
    -> ConduitT a c m (Maybe r1, r2)
    forall i o (m :: * -> *) r.
    (forall b. (r -> Pipe i i o () m b) -> Pipe i i o () m b)
    -> ConduitT i o m r
    ConduitT (Pipe a a b () m r1
    -> Pipe b b c r1 m (Maybe r1, r2) -> Pipe a a c () m (Maybe r1, r2)
    forall (m :: * -> *) l a b r0 r1 c r2.
    Monad m =>
    Pipe l a b r0 m r1 -> Pipe b b c r1 m r2 -> Pipe l a c r0 m r2
    pipeL ((r1 -> Pipe a a b () m r1) -> Pipe a a b () m r1
    forall b. (r1 -> Pipe a a b () m b) -> Pipe a a b () m b
    up r1 -> Pipe a a b () m r1
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) (Maybe r1 -> Pipe b b c () m r2 -> Pipe b b c r1 m (Maybe r1, r2)
    forall (m :: * -> *) u l i o b.
    Monad m =>
    Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go Maybe r1
    forall a. Maybe a
    Nothing (Pipe b b c () m r2 -> Pipe b b c r1 m (Maybe r1, r2))
    -> Pipe b b c () m r2 -> Pipe b b c r1 m (Maybe r1, r2)
    forall a b. (a -> b) -> a -> b
    $ (r2 -> Pipe b b c () m r2) -> Pipe b b c () m r2
    forall b. (r2 -> Pipe b b c () m b) -> Pipe b b c () m b
    down r2 -> Pipe b b c () m r2
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done) Pipe a a c () m (Maybe r1, r2)
    -> ((Maybe r1, r2) -> Pipe a a c () m b) -> Pipe a a c () m b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>=)
      where
        go :: Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go mup :: Maybe u
    mup (Done r :: b
    r) = (Maybe u, b) -> Pipe l i o u m (Maybe u, b)
    forall l i o u (m :: * -> *) r. r -> Pipe l i o u m r
    Done (Maybe u
    mup, b
    r)
        go mup :: Maybe u
    mup (PipeM mp :: m (Pipe l i o () m b)
    mp) = m (Pipe l i o u m (Maybe u, b)) -> Pipe l i o u m (Maybe u, b)
    forall l i o u (m :: * -> *) r.
    m (Pipe l i o u m r) -> Pipe l i o u m r
    PipeM (m (Pipe l i o u m (Maybe u, b)) -> Pipe l i o u m (Maybe u, b))
    -> m (Pipe l i o u m (Maybe u, b)) -> Pipe l i o u m (Maybe u, b)
    forall a b. (a -> b) -> a -> b
    $ (Pipe l i o () m b -> Pipe l i o u m (Maybe u, b))
    -> m (Pipe l i o () m b) -> m (Pipe l i o u m (Maybe u, b))
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go Maybe u
    mup) m (Pipe l i o () m b)
    mp
        go mup :: Maybe u
    mup (HaveOutput p :: Pipe l i o () m b
    p o :: o
    o) = Pipe l i o u m (Maybe u, b) -> o -> Pipe l i o u m (Maybe u, b)
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> o -> Pipe l i o u m r
    HaveOutput (Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go Maybe u
    mup Pipe l i o () m b
    p) o
    o
        go _ (NeedInput p :: i -> Pipe l i o () m b
    p c :: () -> Pipe l i o () m b
    c) = (i -> Pipe l i o u m (Maybe u, b))
    -> (u -> Pipe l i o u m (Maybe u, b))
    -> Pipe l i o u m (Maybe u, b)
    forall l i o u (m :: * -> *) r.
    (i -> Pipe l i o u m r)
    -> (u -> Pipe l i o u m r) -> Pipe l i o u m r
    NeedInput
            (\i :: i
    i -> Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go Maybe u
    forall a. Maybe a
    Nothing (i -> Pipe l i o () m b
    p i
    i))
            (\u :: u
    u -> Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go (u -> Maybe u
    forall a. a -> Maybe a
    Just u
    u) (() -> Pipe l i o () m b
    c ()))
        go mup :: Maybe u
    mup (Leftover p :: Pipe l i o () m b
    p i :: l
    i) = Pipe l i o u m (Maybe u, b) -> l -> Pipe l i o u m (Maybe u, b)
    forall l i o u (m :: * -> *) r.
    Pipe l i o u m r -> l -> Pipe l i o u m r
    Leftover (Maybe u -> Pipe l i o () m b -> Pipe l i o u m (Maybe u, b)
    go Maybe u
    mup Pipe l i o () m b
    p) l
    i
    {-# INLINABLE fuseBothMaybe #-}

    -- | Same as @fuseBoth@, but ignore the return value from the downstream
    -- @Conduit@. Same caveats of forced consumption apply.
    --
    -- Since 1.1.5
    fuseUpstream :: Monad m => ConduitT a b m r -> Conduit b m c -> ConduitT a c m r
    fuseUpstream :: ConduitT a b m r -> Conduit b m c -> ConduitT a c m r
    fuseUpstream up :: ConduitT a b m r
    up down :: Conduit b m c
    down = ((r, ()) -> r) -> ConduitT a c m (r, ()) -> ConduitT a c m r
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (r, ()) -> r
    forall a b. (a, b) -> a
    fst (ConduitT a b m r -> Conduit b m c -> ConduitT a c m (r, ())
    forall (m :: * -> *) a b r1 c r2.
    Monad m =>
    ConduitT a b m r1 -> ConduitT b c m r2 -> ConduitT a c m (r1, r2)
    fuseBoth ConduitT a b m r
    up Conduit b m c
    down)
    {-# INLINE fuseUpstream #-}

    -- Rewrite rules

    {- FIXME
    {-# RULES "conduit: ConduitT: lift x >>= f" forall m f. lift m >>= f = ConduitT (PipeM (liftM (unConduitT . f) m)) #-}
    {-# RULES "conduit: ConduitT: lift x >> f" forall m f. lift m >> f = ConduitT (PipeM (liftM (\_ -> unConduitT f) m)) #-}

    {-# RULES "conduit: ConduitT: liftIO x >>= f" forall m (f :: MonadIO m => a -> ConduitT i o m r). liftIO m >>= f = ConduitT (PipeM (liftM (unConduitT . f) (liftIO m))) #-}
    {-# RULES "conduit: ConduitT: liftIO x >> f" forall m (f :: MonadIO m => ConduitT i o m r). liftIO m >> f = ConduitT (PipeM (liftM (\_ -> unConduitT f) (liftIO m))) #-}

    {-# RULES "conduit: ConduitT: liftBase x >>= f" forall m (f :: MonadBase b m => a -> ConduitT i o m r). liftBase m >>= f = ConduitT (PipeM (liftM (unConduitT . f) (liftBase m))) #-}
    {-# RULES "conduit: ConduitT: liftBase x >> f" forall m (f :: MonadBase b m => ConduitT i o m r). liftBase m >> f = ConduitT (PipeM (liftM (\_ -> unConduitT f) (liftBase m))) #-}

    {-# RULES
        "yield o >> p" forall o (p :: ConduitT i o m r). yield o >> p = ConduitT (HaveOutput (unConduitT p) o)
      ; "when yield next" forall b o p. when b (yield o) >> p =
            if b then ConduitT (HaveOutput (unConduitT p) o) else p
      ; "unless yield next" forall b o p. unless b (yield o) >> p =
            if b then p else ConduitT (HaveOutput (unConduitT p) o)
      ; "lift m >>= yield" forall m. lift m >>= yield = yieldM m
       #-}
    {-# RULES "conduit: leftover l >> p" forall l (p :: ConduitT i o m r). leftover l >> p =
        ConduitT (Leftover (unConduitT p) l) #-}
        -}

    -- | Run a pure pipeline until processing completes, i.e. a pipeline
    -- with @Identity@ as the base monad. This is equivalient to
    -- @runIdentity . runConduit@.
    --
    -- @since 1.2.8
    runConduitPure :: ConduitT () Void Identity r -> r
    runConduitPure :: ConduitT () Void Identity r -> r
    runConduitPure = Identity r -> r
    forall a. Identity a -> a
    runIdentity (Identity r -> r)
    -> (ConduitT () Void Identity r -> Identity r)
    -> ConduitT () Void Identity r
    -> r
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ConduitT () Void Identity r -> Identity r
    forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
    runConduit
    {-# INLINE runConduitPure #-}

    -- | Run a pipeline which acquires resources with @ResourceT@, and
    -- then run the @ResourceT@ transformer. This is equivalent to
    -- @runResourceT . runConduit@.
    --
    -- @since 1.2.8
    runConduitRes :: MonadUnliftIO m
                  => ConduitT () Void (ResourceT m) r
                  -> m r
    runConduitRes :: ConduitT () Void (ResourceT m) r -> m r
    runConduitRes = ResourceT m r -> m r
    forall (m :: * -> *) a. MonadUnliftIO m => ResourceT m a -> m a
    runResourceT (ResourceT m r -> m r)
    -> (ConduitT () Void (ResourceT m) r -> ResourceT m r)
    -> ConduitT () Void (ResourceT m) r
    -> m r
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ConduitT () Void (ResourceT m) r -> ResourceT m r
    forall (m :: * -> *) r. Monad m => ConduitT () Void m r -> m r
    runConduit
    {-# INLINE runConduitRes #-}