Hoogle Search

Within LTS Haskell 24.10 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. conduitObjectEither :: forall k v (m :: Type -> Type) . (FromJSONKey k, FromJSON v, Monad m) => ConduitM ByteString (Either ParserError (k, v)) m ()

    conduit-aeson Data.Conduit.Aeson

    Same as conduitObject, except fails gracefully. Parse a top level object into a stream of key/value pairs with potential failures as Left ParserError.

  2. conduitObjectParserEither :: forall (m :: Type -> Type) . Monad m => ConduitM ByteString (Either ParseError (PositionRange, Maybe (Text, Value))) m ()

    conduit-aeson Data.Conduit.Aeson

    Parse a top level key value mapping. Expects opening and closing braces '{' and '}'. Nothing indicates terminating closing curly brace has been reached, but it does not mean there are no left over bytes in the input stream.

  3. conduitObjectParserNoStartEither :: forall (m :: Type -> Type) a . Monad m => Parser a -> ConduitM ByteString (Either ParseError (PositionRange, (Text, Value))) m ()

    conduit-aeson Data.Conduit.Aeson

    Parse a stream of key/value pairs. Expects that there are no opening or closing top level curly braces '{' and '}'. It is suitable for infinite streams of key value/pairs delimited by a custom character, eg. a new line.

    Examples

    >>> import Conduit
    
    >>> import Data.Conduit.Aeson
    
    >>> import Data.ByteString.Char8 (ByteString, pack)
    
    >>> import Data.Attoparsec.ByteString.Char8 (char8)
    
    >>> let input = pack "\"foo\":1|\"bar\":2|" :: ByteString
    
    >>> let parser = conduitObjectParserNoStartEither (char8 '|')
    
    >>> runConduit (yield input .| parser .| printC)
    Right (1:1 (0)-1:9 (8),("foo",Number 1.0))
    Right (1:9 (8)-1:17 (16),("bar",Number 2.0))
    

  4. conduitPossiblyCompressedFile :: forall (m :: Type -> Type) . (MonadUnliftIO m, MonadResource m, MonadThrow m) => FilePath -> ConduitT () ByteString m ()

    conduit-algorithms Data.Conduit.Algorithms.Async

    If the filename indicates a gzipped file (or, on Unix, also a bz2 file), then it reads it and uncompresses it. To ensure that the file is closed even if the downstream finishes early, consider using withPossiblyCompressedFile. On Windows, attempting to read from a bzip2 file, results in error.

  5. conduitPossiblyCompressedToFile :: forall (m :: Type -> Type) . (MonadUnliftIO m, MonadResource m) => FilePath -> ConduitT ByteString Void m ()

    conduit-algorithms Data.Conduit.Algorithms.Async

    If the filename indicates a gzipped file (or, on Unix, also a bz2 file), then it compresses and write with the algorithm matching the filename Consider using withPossiblyCompressedFileOutput to ensure prompt file closing. On Windows, attempting to write to a bzip2 file, results in error.

  6. conduitEither :: forall a (m :: Type -> Type) r . (a ~ ByteString, Monad m) => ConduitT a (Either ByteString ByteString) m r -> Segment m r

    shell-conduit Data.Conduit.Shell.Process

    Lift a conduit into a segment, which can yield stderr.

  7. conduitDecode :: forall (m :: Type -> Type) a . (MonadResource m, Store a) => Maybe Int -> Conduit ByteString m (Message a)

    store-streaming Data.Store.Streaming

    Conduit for decoding Messages from ByteStrings.

  8. conduitEncode :: forall (m :: Type -> Type) a . (Monad m, Store a) => Conduit (Message a) m ByteString

    store-streaming Data.Store.Streaming

    Conduit for encoding Messages to ByteStrings.

  9. data SealedConduitT i o (m :: Type -> Type) r

    conduit Data.Conduit

    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.

  10. newtype ZipConduit i o (m :: Type -> Type) r

    conduit Data.Conduit

    Provides an alternative Applicative instance for ConduitT. In this instance, every incoming value is provided to all ConduitTs, and output is coalesced together. Leftovers from individual ConduitTs will be used within that component, and then discarded at the end of their computation. Output and finalizers will both be handled in a left-biased manner. As an example, take the following program:

    main :: IO ()
    main = do
    let src = mapM_ yield [1..3 :: Int]
    conduit1 = CL.map (+1)
    conduit2 = CL.concatMap (replicate 2)
    conduit = getZipConduit $ ZipConduit conduit1 <* ZipConduit conduit2
    sink = CL.mapM_ print
    src $$ conduit =$ sink
    
    It will produce the output: 2, 1, 1, 3, 2, 2, 4, 3, 3 Since 1.0.17

Page 5 of many | Previous | Next