Copyright | Isaac Jones 2003-2005 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Distribution.PackageDescription.Parsec
Description
This defined parsers and partial pretty printers for the .cabal
format.
Synopsis
- readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
- parseGenericPackageDescription :: ByteString -> ParseResult GenericPackageDescription
- parseGenericPackageDescriptionMaybe :: ByteString -> Maybe GenericPackageDescription
- data ParseResult a
- runParseResult :: ParseResult a -> ([PWarning], [PError], Maybe a)
- readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
- parseHookedBuildInfo :: ByteString -> ParseResult HookedBuildInfo
Package descriptions
readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription Source #
Parse the given package file.
parseGenericPackageDescription :: ByteString -> ParseResult GenericPackageDescription Source #
Parses the given file into a GenericPackageDescription
.
In Cabal 1.2 the syntax for package descriptions was changed to a format with sections and possibly indented property descriptions.
parseGenericPackageDescriptionMaybe :: ByteString -> Maybe GenericPackageDescription Source #
Maybe
variant of parseGenericPackageDescription
Parsing
data ParseResult a Source #
A monad with failure and accumulating errors and warnings.
Instances
Monad ParseResult # | |
Methods (>>=) :: ParseResult a -> (a -> ParseResult b) -> ParseResult b Source # (>>) :: ParseResult a -> ParseResult b -> ParseResult b Source # return :: a -> ParseResult a Source # fail :: String -> ParseResult a Source # | |
Functor ParseResult # | |
Methods fmap :: (a -> b) -> ParseResult a -> ParseResult b Source # (<$) :: a -> ParseResult b -> ParseResult a Source # | |
Applicative ParseResult # | |
Methods pure :: a -> ParseResult a Source # (<*>) :: ParseResult (a -> b) -> ParseResult a -> ParseResult b Source # liftA2 :: (a -> b -> c) -> ParseResult a -> ParseResult b -> ParseResult c Source # (*>) :: ParseResult a -> ParseResult b -> ParseResult b Source # (<*) :: ParseResult a -> ParseResult b -> ParseResult a Source # |
runParseResult :: ParseResult a -> ([PWarning], [PError], Maybe a) Source #
Destruct a ParseResult
into the emitted warnings and errors, and
possibly the final result if there were no errors.
Supplementary build information
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo Source #