Distribution.Text

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 Source #

Minimal complete definition

disp, parse

Methods

disp :: a -> Doc Source #

parse :: ReadP r a Source #

Instances

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

defaultStyle :: Style Source #

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 Source #

Pretty-prints with the default style.

flatStyle :: Style Source #

A style for rendering all on one line.

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

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