Copyright | (c) 2016-2017 Red Hat Inc. |
---|---|
License | LGPL |
Maintainer | https://github.com/weldr |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
A module for interacting with an RPM
record using conduits.
- parseRPMC :: MonadError ParseError m => Conduit ByteString m RPM
- payloadC :: Monad m => Conduit RPM m ByteString
- payloadContentsC :: (MonadResource m, MonadThrow m) => Conduit RPM m Entry
Documentation
parseRPMC :: MonadError ParseError m => Conduit ByteString m RPM Source #
Like parseRPM
, but puts the result into a Conduit
as an Either
, containing either a
ParseError
or an RPM
. The result can be extracted with runExceptT
,
like so:
import Conduit((.|), runConduitRes, sourceFile) import Control.Monad.Except(runExceptT) result <- runExceptT $ runConduitRes $ sourceFile "some.rpm" .| parseRPMC .| someConsumer
On success, the RPM
record will be passed down the conduit for futher processing or
consumption. On error, the rest of the conduit will be skipped and the ParseError
will
be returned as the result to be dealt with.
payloadC :: Monad m => Conduit RPM m ByteString Source #
Extract the package payload from an RPM
, returning it in the conduit.
payloadContentsC :: (MonadResource m, MonadThrow m) => Conduit RPM m Entry Source #