Distribution.Text

Cabal-2.4.0.1: 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 it 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
  - disp :: a -> Doc
  - parse :: ReadP r a
- 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 #

Note: this class will soon be deprecated. It's not yet, so that we are `-Wall` clean.

Minimal complete definition

Nothing

Methods

disp :: a -> Doc #

disp :: Pretty a => a -> Doc #

parse :: ReadP r a #

parse :: Parsec a => ReadP r a #

Instances

Text Bool # |
Instance details Defined in Distribution.Text Methods disp :: Bool -> Doc # parse :: ReadP r Bool #
Text Int # |
Instance details Defined in Distribution.Text Methods disp :: Int -> Doc # parse :: ReadP r Int #
Text Version # |
Instance details Defined in Distribution.Text Methods disp :: Version -> Doc # parse :: ReadP r Version #
Text Version # |
Instance details Defined in Distribution.Types.Version Methods disp :: Version -> Doc # parse :: ReadP r Version #
Text VersionRange # |
Instance details Defined in Distribution.Types.VersionRange Methods disp :: VersionRange -> Doc # parse :: ReadP r VersionRange #
Text RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods disp :: RepoType -> Doc # parse :: ReadP r RepoType #
Text RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods disp :: RepoKind -> Doc # parse :: ReadP r RepoKind #
Text PkgconfigName # |
Instance details Defined in Distribution.Types.PkgconfigName Methods disp :: PkgconfigName -> Doc # parse :: ReadP r PkgconfigName #
Text ForeignLibType # |
Instance details Defined in Distribution.Types.ForeignLibType Methods disp :: ForeignLibType -> Doc # parse :: ReadP r ForeignLibType #
Text ForeignLibOption # |
Instance details Defined in Distribution.Types.ForeignLibOption Methods disp :: ForeignLibOption -> Doc # parse :: ReadP r ForeignLibOption #
Text ExecutableScope # |
Instance details Defined in Distribution.Types.ExecutableScope Methods disp :: ExecutableScope -> Doc # parse :: ReadP r ExecutableScope #
Text ComponentId # |
Instance details Defined in Distribution.Types.ComponentId Methods disp :: ComponentId -> Doc # parse :: ReadP r ComponentId #
Text BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods disp :: BuildType -> Doc # parse :: ReadP r BuildType #
Text AbiHash # |
Instance details Defined in Distribution.Types.AbiHash Methods disp :: AbiHash -> Doc # parse :: ReadP r AbiHash #
Text Platform # |
Instance details Defined in Distribution.System Methods disp :: Platform -> Doc # parse :: ReadP r Platform #
Text Arch # |
Instance details Defined in Distribution.System Methods disp :: Arch -> Doc # parse :: ReadP r Arch #
Text OS # |
Instance details Defined in Distribution.System Methods disp :: OS -> Doc # parse :: ReadP r OS #
Text ModuleName # |
Instance details Defined in Distribution.ModuleName Methods disp :: ModuleName -> Doc # parse :: ReadP r ModuleName #
Text ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods disp :: ModuleRenaming -> Doc # parse :: ReadP r ModuleRenaming #
Text IncludeRenaming # |
Instance details Defined in Distribution.Types.IncludeRenaming Methods disp :: IncludeRenaming -> Doc # parse :: ReadP r IncludeRenaming #
Text TestType # |
Instance details Defined in Distribution.Types.TestType Methods disp :: TestType -> Doc # parse :: ReadP r TestType #
Text PkgconfigDependency # |
Instance details Defined in Distribution.Types.PkgconfigDependency Methods disp :: PkgconfigDependency -> Doc # parse :: ReadP r PkgconfigDependency #
Text BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods disp :: BenchmarkType -> Doc # parse :: ReadP r BenchmarkType #
Text License # |
Instance details Defined in Distribution.License Methods disp :: License -> Doc # parse :: ReadP r License #
Text KnownExtension # |
Instance details Defined in Language.Haskell.Extension Methods disp :: KnownExtension -> Doc # parse :: ReadP r KnownExtension #
Text Extension # |
Instance details Defined in Language.Haskell.Extension Methods disp :: Extension -> Doc # parse :: ReadP r Extension #
Text Language # |
Instance details Defined in Language.Haskell.Extension Methods disp :: Language -> Doc # parse :: ReadP r Language #
Text AbiTag # |
Instance details Defined in Distribution.Compiler Methods disp :: AbiTag -> Doc # parse :: ReadP r AbiTag #
Text CompilerId # |
Instance details Defined in Distribution.Compiler Methods disp :: CompilerId -> Doc # parse :: ReadP r CompilerId #
Text CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods disp :: CompilerFlavor -> Doc # parse :: ReadP r CompilerFlavor #
Text PackageName # |
Instance details Defined in Distribution.Types.PackageName Methods disp :: PackageName -> Doc # parse :: ReadP r PackageName #
Text UnqualComponentName # |
Instance details Defined in Distribution.Types.UnqualComponentName Methods disp :: UnqualComponentName -> Doc # parse :: ReadP r UnqualComponentName #
Text ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods disp :: ComponentName -> Doc # parse :: ReadP r ComponentName #
Text PackageIdentifier # |
Instance details Defined in Distribution.Types.PackageId Methods disp :: PackageIdentifier -> Doc # parse :: ReadP r PackageIdentifier #
Text DefUnitId # |
Instance details Defined in Distribution.Types.UnitId Methods disp :: DefUnitId -> Doc # parse :: ReadP r DefUnitId #
Text UnitId # |
Instance details Defined in Distribution.Types.UnitId Methods disp :: UnitId -> Doc # parse :: ReadP r UnitId #
Text Module # |
Instance details Defined in Distribution.Types.Module Methods disp :: Module -> Doc # parse :: ReadP r Module #
Text OpenModule # |
Instance details Defined in Distribution.Backpack Methods disp :: OpenModule -> Doc # parse :: ReadP r OpenModule #
Text OpenUnitId # |
Instance details Defined in Distribution.Backpack Methods disp :: OpenUnitId -> Doc # parse :: ReadP r OpenUnitId #
Text ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods disp :: ModuleReexport -> Doc # parse :: ReadP r ModuleReexport #
Text Mixin # |
Instance details Defined in Distribution.Types.Mixin Methods disp :: Mixin -> Doc # parse :: ReadP r Mixin #
Text ExeDependency # |
Instance details Defined in Distribution.Types.ExeDependency Methods disp :: ExeDependency -> Doc # parse :: ReadP r ExeDependency #
Text Dependency # |
Instance details Defined in Distribution.Types.Dependency Methods disp :: Dependency -> Doc # parse :: ReadP r Dependency #
Text MungedPackageName # |
Instance details Defined in Distribution.Types.MungedPackageName Methods disp :: MungedPackageName -> Doc # parse :: ReadP r MungedPackageName #
Text MungedPackageId # |
Instance details Defined in Distribution.Types.MungedPackageId Methods disp :: MungedPackageId -> Doc # parse :: ReadP r MungedPackageId #
Text AbiDependency # |
Instance details Defined in Distribution.Types.AbiDependency Methods disp :: AbiDependency -> Doc # parse :: ReadP r AbiDependency #
Text LegacyExeDependency # |
Instance details Defined in Distribution.Types.LegacyExeDependency Methods disp :: LegacyExeDependency -> Doc # parse :: ReadP r LegacyExeDependency #
Text LibVersionInfo # |
Instance details Defined in Distribution.Types.ForeignLib Methods disp :: LibVersionInfo -> Doc # parse :: ReadP r LibVersionInfo #
Text FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods disp :: FlagName -> Doc # parse :: ReadP r FlagName #
Text ExposedModule # |
Instance details Defined in Distribution.Types.ExposedModule Methods disp :: ExposedModule -> Doc # parse :: ReadP r ExposedModule #
Text TestShowDetails # |
Instance details Defined in Distribution.Simple.Setup Methods disp :: TestShowDetails -> Doc # parse :: ReadP r TestShowDetails #
Text HaddockTarget # |
Instance details Defined in Distribution.Simple.Setup Methods disp :: HaddockTarget -> Doc # parse :: ReadP r HaddockTarget #
Text a => Text (Identity a) # |
Instance details Defined in Distribution.Text Methods disp :: Identity a -> Doc # parse :: ReadP r (Identity a) #

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 #