Cabal-1.3.4: A framework for packaging Haskell softwareContentsIndex
Distribution.PackageDescription.Parse
Portabilityportable
Stabilityalpha
MaintainerIsaac Jones <ijones@syntaxpolice.org>
Contents
Package descriptions
Parsing
Supplementary build information
Description
Package description and parsing.
Synopsis
readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
writePackageDescription :: FilePath -> PackageDescription -> IO ()
parsePackageDescription :: String -> ParseResult GenericPackageDescription
showPackageDescription :: PackageDescription -> String
data ParseResult a
= ParseFailed PError
| ParseOk [PWarning] a
data FieldDescr a = FieldDescr {
fieldName :: String
fieldGet :: (a -> Doc)
fieldSet :: (LineNo -> String -> a -> ParseResult a)
}
type LineNo = Int
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
parseHookedBuildInfo :: String -> ParseResult HookedBuildInfo
writeHookedBuildInfo :: FilePath -> HookedBuildInfo -> IO ()
showHookedBuildInfo :: HookedBuildInfo -> String
Package descriptions
readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
Parse the given package file.
writePackageDescription :: FilePath -> PackageDescription -> IO ()
parsePackageDescription :: String -> ParseResult GenericPackageDescription

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.

showPackageDescription :: PackageDescription -> String
Parsing
data ParseResult a
Constructors
ParseFailed PError
ParseOk [PWarning] a
show/hide Instances
data FieldDescr a
Field descriptor. The parameter a parameterizes over where the field's value is stored in.
Constructors
FieldDescr
fieldName :: String
fieldGet :: (a -> Doc)
fieldSet :: (LineNo -> String -> a -> ParseResult a)fieldSet n str x Parses the field value from the given input string str and stores the result in x if the parse was successful. Otherwise, reports an error on line number n.
type LineNo = Int
Supplementary build information
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
parseHookedBuildInfo :: String -> ParseResult HookedBuildInfo
writeHookedBuildInfo :: FilePath -> HookedBuildInfo -> IO ()
showHookedBuildInfo :: HookedBuildInfo -> String
Produced by Haddock version 0.9