codec-rpm-0.2.1: A library for manipulating RPM files

Copyright(c) 2016-2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Codec.RPM.Parse

Description

A module for creating RPM records from various data sources.

Synopsis

Documentation

parseRPM :: Parser RPM Source #

A parser (in the attoparsec sense of the term) that constructs RPM records. The parser can be run against a ByteString of RPM data using any of the usual functions. parse and parseOnly are especially useful:

import Data.Attoparsec.ByteString(parse)
import qualified Data.ByteString as BS
s <- BS.readFile "some.rpm"
result <- parse parseRPM s

The Result can then be examined directly or converted using maybeResult (for converting it into a Maybe RPM) or eitherResult (for converting it into an Either String RPM). In the latter case, the String contains any parse error that occurred when reading the RPM data.