Cabal-2.0.1.0: A framework for packaging Haskell software

Copyright | Duncan Coutts 2007
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Text

Description

This defines a `Text` class which is a bit like the `Read` and `Show` classes. The difference is that is uses a modern pretty printer and parser system and the format is not expected to be Haskell concrete syntax but rather the external human readable representation used by Cabal.

Synopsis

- class Text a where
- defaultStyle :: Style
- display :: Text a => a -> String
- flatStyle :: Style
- simpleParse :: Text a => String -> Maybe a
- stdParse :: Text ver => (ver -> String -> res) -> ReadP r res

# Documentation

class Text a where #

Minimal complete definition

disp, parse

Methods

disp :: a -> Doc #

parse :: ReadP r a #

Instances

Text Bool # |
Methods disp :: Bool -> Doc # parse :: ReadP r Bool #
Text Int # |
Methods disp :: Int -> Doc # parse :: ReadP r Int #
Text Version # |
Methods disp :: Version -> Doc # parse :: ReadP r Version #
Text Platform # |
Methods disp :: Platform -> Doc # parse :: ReadP r Platform #
Text Arch # |
Methods disp :: Arch -> Doc # parse :: ReadP r Arch #
Text OS # |
Methods disp :: OS -> Doc # parse :: ReadP r OS #
Text BuildType # |
Methods disp :: BuildType -> Doc # parse :: ReadP r BuildType #
Text ExecutableScope # |
Methods disp :: ExecutableScope -> Doc # parse :: ReadP r ExecutableScope #
Text ForeignLibOption # |
Methods disp :: ForeignLibOption -> Doc # parse :: ReadP r ForeignLibOption #
Text ForeignLibType # |
Methods disp :: ForeignLibType -> Doc # parse :: ReadP r ForeignLibType #
Text RepoType # |
Methods disp :: RepoType -> Doc # parse :: ReadP r RepoType #
Text RepoKind # |
Methods disp :: RepoKind -> Doc # parse :: ReadP r RepoKind #
Text PkgconfigName # |
Methods disp :: PkgconfigName -> Doc # parse :: ReadP r PkgconfigName #
Text ComponentId # |
Methods disp :: ComponentId -> Doc # parse :: ReadP r ComponentId #
Text AbiHash # |
Methods disp :: AbiHash -> Doc # parse :: ReadP r AbiHash #
Text ModuleName # |
Methods disp :: ModuleName -> Doc # parse :: ReadP r ModuleName #
Text ModuleRenaming # |
Methods disp :: ModuleRenaming -> Doc # parse :: ReadP r ModuleRenaming #
Text IncludeRenaming # |
Methods disp :: IncludeRenaming -> Doc # parse :: ReadP r IncludeRenaming #
Text VersionRange # |
Methods disp :: VersionRange -> Doc # parse :: ReadP r VersionRange #
Text Version # |
Methods disp :: Version -> Doc # parse :: ReadP r Version #
Text TestType # |
Methods disp :: TestType -> Doc # parse :: ReadP r TestType #
Text PkgconfigDependency # |
Methods disp :: PkgconfigDependency -> Doc # parse :: ReadP r PkgconfigDependency #
Text BenchmarkType # |
Methods disp :: BenchmarkType -> Doc # parse :: ReadP r BenchmarkType #
Text License # |
Methods disp :: License -> Doc # parse :: ReadP r License #
Text KnownExtension # |
Methods disp :: KnownExtension -> Doc # parse :: ReadP r KnownExtension #
Text Extension # |
Methods disp :: Extension -> Doc # parse :: ReadP r Extension #
Text Language # |
Methods disp :: Language -> Doc # parse :: ReadP r Language #
Text AbiTag # |
Methods disp :: AbiTag -> Doc # parse :: ReadP r AbiTag #
Text CompilerId # |
Methods disp :: CompilerId -> Doc # parse :: ReadP r CompilerId #
Text CompilerFlavor # |
Methods disp :: CompilerFlavor -> Doc # parse :: ReadP r CompilerFlavor #
Text PackageName # |
Methods disp :: PackageName -> Doc # parse :: ReadP r PackageName #
Text UnqualComponentName # |
Methods disp :: UnqualComponentName -> Doc # parse :: ReadP r UnqualComponentName #
Text ComponentName # |
Methods disp :: ComponentName -> Doc # parse :: ReadP r ComponentName #
Text PackageIdentifier # |
Methods disp :: PackageIdentifier -> Doc # parse :: ReadP r PackageIdentifier #
Text DefUnitId # |
Methods disp :: DefUnitId -> Doc # parse :: ReadP r DefUnitId #
Text UnitId # | The textual format for `UnitId` coincides with the format GHC accepts for `-package-id`.
Methods disp :: UnitId -> Doc # parse :: ReadP r UnitId #
Text Module # |
Methods disp :: Module -> Doc # parse :: ReadP r Module #
Text OpenModule # |
Methods disp :: OpenModule -> Doc # parse :: ReadP r OpenModule #
Text OpenUnitId # |
Methods disp :: OpenUnitId -> Doc # parse :: ReadP r OpenUnitId #
Text ModuleReexport # |
Methods disp :: ModuleReexport -> Doc # parse :: ReadP r ModuleReexport #
Text Mixin # |
Methods disp :: Mixin -> Doc # parse :: ReadP r Mixin #
Text ExeDependency # |
Methods disp :: ExeDependency -> Doc # parse :: ReadP r ExeDependency #
Text Dependency # |
Methods disp :: Dependency -> Doc # parse :: ReadP r Dependency #
Text MungedPackageName # |
Methods disp :: MungedPackageName -> Doc # parse :: ReadP r MungedPackageName #
Text MungedPackageId # |
Methods disp :: MungedPackageId -> Doc # parse :: ReadP r MungedPackageId #
Text LegacyExeDependency # |
Methods disp :: LegacyExeDependency -> Doc # parse :: ReadP r LegacyExeDependency #
Text LibVersionInfo # |
Methods disp :: LibVersionInfo -> Doc # parse :: ReadP r LibVersionInfo #
Text AbiDependency # |
Methods disp :: AbiDependency -> Doc # parse :: ReadP r AbiDependency #
Text ExposedModule # |
Methods disp :: ExposedModule -> Doc # parse :: ReadP r ExposedModule #
Text TestShowDetails # |
Methods disp :: TestShowDetails -> Doc # parse :: ReadP r TestShowDetails #
Text RelaxedDep # |
Methods disp :: RelaxedDep -> Doc # parse :: ReadP r RelaxedDep #

defaultStyle :: Style #

The default rendering style used in Cabal for console output. It has a fixed page width and adds line breaks automatically.

display :: Text a => a -> String #

Pretty-prints with the default style.

flatStyle :: Style #

A style for rendering all on one line.

simpleParse :: Text a => String -> Maybe a #

stdParse :: Text ver => (ver -> String -> res) -> ReadP r res #