Cabal-2.0.1.1: A framework for packaging Haskell software

CopyrightIsaac Jones 2003-2005
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.PackageDescription.Parse

Contents

Description

This defined parsers and partial pretty printers for the .cabal format. Some of the complexity in this module is due to the fact that we have to be backwards compatible with old .cabal files, so there's code to translate into the newer structure.

Synopsis

Package descriptions

parseGenericPackageDescription :: String -> 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.

Deprecated names

readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription Source #

Deprecated: Use readGenericPackageDescription, old name is misleading.

parsePackageDescription :: String -> ParseResult GenericPackageDescription Source #

Deprecated: Use parseGenericPackageDescription, old name is misleading

Parsing

data ParseResult a Source #

Constructors

ParseFailed PError 
ParseOk [PWarning] a 
Instances
Monad ParseResult Source # 
Instance details
Functor ParseResult Source # 
Instance details

Methods

fmap :: (a -> b) -> ParseResult a -> ParseResult b #

(<$) :: a -> ParseResult b -> ParseResult a #

MonadFail ParseResult Source # 
Instance details

Methods

fail :: String -> ParseResult a #

Applicative ParseResult Source # 
Instance details

Methods

pure :: a -> ParseResult a #

(<*>) :: ParseResult (a -> b) -> ParseResult a -> ParseResult b #

liftA2 :: (a -> b -> c) -> ParseResult a -> ParseResult b -> ParseResult c #

(*>) :: ParseResult a -> ParseResult b -> ParseResult b #

(<*) :: ParseResult a -> ParseResult b -> ParseResult a #

Show a => Show (ParseResult a) Source # 
Instance details

data FieldDescr a Source #

Field descriptor. The parameter a parameterizes over where the field's value is stored in.

Constructors

FieldDescr 

Fields

Private, but needed for pretty-printer

data TestSuiteStanza Source #

An intermediate type just used for parsing the test-suite stanza. After validation it is converted into the proper TestSuite type.

data BenchmarkStanza Source #

An intermediate type just used for parsing the benchmark stanza. After validation it is converted into the proper Benchmark type.

Supplementary build information