Distribution.Pretty

Cabal-3.0.0.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Pretty

Contents

- Utilities
- Deprecated

Synopsis

- class Pretty a where
  - pretty :: a -> Doc
  - prettyVersioned :: CabalSpecVersion -> a -> Doc
- prettyShow :: Pretty a => a -> String
- defaultStyle :: Style
- flatStyle :: Style
- showFilePath :: FilePath -> Doc
- showToken :: String -> Doc
- showFreeText :: String -> Doc
- showFreeTextV3 :: String -> Doc
- type Separator = [Doc] -> Doc

# Documentation

class Pretty a where Source #

Minimal complete definition

pretty

Methods

pretty :: a -> Doc Source #

prettyVersioned :: CabalSpecVersion -> a -> Doc Source #

#### Instances

Instances details

Pretty Bool # |
Instance details Defined in Distribution.Pretty Methods pretty :: Bool -> Doc Source # prettyVersioned :: CabalSpecVersion -> Bool -> Doc Source #
Pretty Int # |
Instance details Defined in Distribution.Pretty Methods pretty :: Int -> Doc Source # prettyVersioned :: CabalSpecVersion -> Int -> Doc Source #
Pretty Version # |
Instance details Defined in Distribution.Types.Version Methods pretty :: Version -> Doc Source # prettyVersioned :: CabalSpecVersion -> Version -> Doc Source #
Pretty VersionRange # |
Instance details Defined in Distribution.Types.VersionRange.Internal Methods pretty :: VersionRange -> Doc Source # prettyVersioned :: CabalSpecVersion -> VersionRange -> Doc Source #
Pretty RepoType # |
Instance details Defined in Distribution.Types.SourceRepo Methods pretty :: RepoType -> Doc Source # prettyVersioned :: CabalSpecVersion -> RepoType -> Doc Source #
Pretty RepoKind # |
Instance details Defined in Distribution.Types.SourceRepo Methods pretty :: RepoKind -> Doc Source # prettyVersioned :: CabalSpecVersion -> RepoKind -> Doc Source #
Pretty PkgconfigVersion # |
Instance details Defined in Distribution.Types.PkgconfigVersion Methods pretty :: PkgconfigVersion -> Doc Source # prettyVersioned :: CabalSpecVersion -> PkgconfigVersion -> Doc Source #
Pretty PkgconfigVersionRange # |
Instance details Defined in Distribution.Types.PkgconfigVersionRange Methods pretty :: PkgconfigVersionRange -> Doc Source # prettyVersioned :: CabalSpecVersion -> PkgconfigVersionRange -> Doc Source #
Pretty PkgconfigName # |
Instance details Defined in Distribution.Types.PkgconfigName Methods pretty :: PkgconfigName -> Doc Source # prettyVersioned :: CabalSpecVersion -> PkgconfigName -> Doc Source #
Pretty PkgconfigDependency # |
Instance details Defined in Distribution.Types.PkgconfigDependency Methods pretty :: PkgconfigDependency -> Doc Source # prettyVersioned :: CabalSpecVersion -> PkgconfigDependency -> Doc Source #
Pretty PackageName # |
Instance details Defined in Distribution.Types.PackageName Methods pretty :: PackageName -> Doc Source # prettyVersioned :: CabalSpecVersion -> PackageName -> Doc Source #
Pretty UnqualComponentName # |
Instance details Defined in Distribution.Types.UnqualComponentName Methods pretty :: UnqualComponentName -> Doc Source # prettyVersioned :: CabalSpecVersion -> UnqualComponentName -> Doc Source #
Pretty PackageVersionConstraint # |
Instance details Defined in Distribution.Types.PackageVersionConstraint Methods pretty :: PackageVersionConstraint -> Doc Source # prettyVersioned :: CabalSpecVersion -> PackageVersionConstraint -> Doc Source #
Pretty LibraryVisibility # |
Instance details Defined in Distribution.Types.LibraryVisibility Methods pretty :: LibraryVisibility -> Doc Source # prettyVersioned :: CabalSpecVersion -> LibraryVisibility -> Doc Source #
Pretty MungedPackageName # | Computes the package name for a library. If this is the public library, it will just be the original package name; otherwise, it will be a munged package name recording the original package name as well as the name of the internal library. A lot of tooling in the Haskell ecosystem assumes that if something is installed to the package database with the package name `foo`, then it actually is an entry for the (only public) library in package `foo`. With internal packages, this is not necessarily true: a public library as well as arbitrarily many internal libraries may come from the same package. To prevent tools from getting confused in this case, the package name of these internal libraries is munged so that they do not conflict the public library proper. A particular case where this matters is ghc-pkg: if we don't munge the package name, the inplace registration will OVERRIDE a different internal library. We munge into a reserved namespace, "z-", and encode both the component name and the package name of an internal library using the following format: compat-pkg-name ::= "z-" package-name "-z-" library-name where package-name and library-name have "-" ( "z" + ) "-" segments encoded by adding an extra "z". When we have the public library, the compat-pkg-name is just the package-name, no surprises there!
    >>> prettyShow $ MungedPackageName "servant" LMainLibName
    "servant"
    >>> prettyShow $ MungedPackageName "servant" (LSubLibName "lackey")
    "z-servant-z-lackey"
Instance details Defined in Distribution.Types.MungedPackageName Methods pretty :: MungedPackageName -> Doc Source # prettyVersioned :: CabalSpecVersion -> MungedPackageName -> Doc Source #
Pretty ForeignLibType # |
Instance details Defined in Distribution.Types.ForeignLibType Methods pretty :: ForeignLibType -> Doc Source # prettyVersioned :: CabalSpecVersion -> ForeignLibType -> Doc Source #
Pretty ForeignLibOption # |
Instance details Defined in Distribution.Types.ForeignLibOption Methods pretty :: ForeignLibOption -> Doc Source # prettyVersioned :: CabalSpecVersion -> ForeignLibOption -> Doc Source #
Pretty ExecutableScope # |
Instance details Defined in Distribution.Types.ExecutableScope Methods pretty :: ExecutableScope -> Doc Source # prettyVersioned :: CabalSpecVersion -> ExecutableScope -> Doc Source #
Pretty ComponentName # |
Instance details Defined in Distribution.Types.ComponentName Methods pretty :: ComponentName -> Doc Source # prettyVersioned :: CabalSpecVersion -> ComponentName -> Doc Source #
Pretty ComponentId # |
Instance details Defined in Distribution.Types.ComponentId Methods pretty :: ComponentId -> Doc Source # prettyVersioned :: CabalSpecVersion -> ComponentId -> Doc Source #
Pretty BuildType # |
Instance details Defined in Distribution.Types.BuildType Methods pretty :: BuildType -> Doc Source # prettyVersioned :: CabalSpecVersion -> BuildType -> Doc Source #
Pretty AbiHash # |
Instance details Defined in Distribution.Types.AbiHash Methods pretty :: AbiHash -> Doc Source # prettyVersioned :: CabalSpecVersion -> AbiHash -> Doc Source #
Pretty Platform # |
Instance details Defined in Distribution.System Methods pretty :: Platform -> Doc Source # prettyVersioned :: CabalSpecVersion -> Platform -> Doc Source #
Pretty Arch # |
Instance details Defined in Distribution.System Methods pretty :: Arch -> Doc Source # prettyVersioned :: CabalSpecVersion -> Arch -> Doc Source #
Pretty OS # |
Instance details Defined in Distribution.System Methods pretty :: OS -> Doc Source # prettyVersioned :: CabalSpecVersion -> OS -> Doc Source #
Pretty LicenseRef # |
Instance details Defined in Distribution.SPDX.LicenseReference Methods pretty :: LicenseRef -> Doc Source # prettyVersioned :: CabalSpecVersion -> LicenseRef -> Doc Source #
Pretty LicenseId # |
Instance details Defined in Distribution.SPDX.LicenseId Methods pretty :: LicenseId -> Doc Source # prettyVersioned :: CabalSpecVersion -> LicenseId -> Doc Source #
Pretty LicenseExceptionId # |
Instance details Defined in Distribution.SPDX.LicenseExceptionId Methods pretty :: LicenseExceptionId -> Doc Source # prettyVersioned :: CabalSpecVersion -> LicenseExceptionId -> Doc Source #
Pretty SimpleLicenseExpression # |
Instance details Defined in Distribution.SPDX.LicenseExpression Methods pretty :: SimpleLicenseExpression -> Doc Source # prettyVersioned :: CabalSpecVersion -> SimpleLicenseExpression -> Doc Source #
Pretty LicenseExpression # |
Instance details Defined in Distribution.SPDX.LicenseExpression Methods pretty :: LicenseExpression -> Doc Source # prettyVersioned :: CabalSpecVersion -> LicenseExpression -> Doc Source #
Pretty License # |
Instance details Defined in Distribution.SPDX.License Methods pretty :: License -> Doc Source # prettyVersioned :: CabalSpecVersion -> License -> Doc Source #
Pretty ModuleName # |
Instance details Defined in Distribution.ModuleName Methods pretty :: ModuleName -> Doc Source # prettyVersioned :: CabalSpecVersion -> ModuleName -> Doc Source #
Pretty ModuleRenaming # |
Instance details Defined in Distribution.Types.ModuleRenaming Methods pretty :: ModuleRenaming -> Doc Source # prettyVersioned :: CabalSpecVersion -> ModuleRenaming -> Doc Source #
Pretty IncludeRenaming # |
Instance details Defined in Distribution.Types.IncludeRenaming Methods pretty :: IncludeRenaming -> Doc Source # prettyVersioned :: CabalSpecVersion -> IncludeRenaming -> Doc Source #
Pretty Mixin # |
Instance details Defined in Distribution.Types.Mixin Methods pretty :: Mixin -> Doc Source # prettyVersioned :: CabalSpecVersion -> Mixin -> Doc Source #
Pretty ModuleReexport # |
Instance details Defined in Distribution.Types.ModuleReexport Methods pretty :: ModuleReexport -> Doc Source # prettyVersioned :: CabalSpecVersion -> ModuleReexport -> Doc Source #
Pretty TestType # |
Instance details Defined in Distribution.Types.TestType Methods pretty :: TestType -> Doc Source # prettyVersioned :: CabalSpecVersion -> TestType -> Doc Source #
Pretty PackageIdentifier # |
Instance details Defined in Distribution.Types.PackageId Methods pretty :: PackageIdentifier -> Doc Source # prettyVersioned :: CabalSpecVersion -> PackageIdentifier -> Doc Source #
Pretty DefUnitId # |
Instance details Defined in Distribution.Types.UnitId Methods pretty :: DefUnitId -> Doc Source # prettyVersioned :: CabalSpecVersion -> DefUnitId -> Doc Source #
Pretty UnitId # | The textual format for `UnitId` coincides with the format GHC accepts for `-package-id`.
Instance details Defined in Distribution.Types.UnitId Methods pretty :: UnitId -> Doc Source # prettyVersioned :: CabalSpecVersion -> UnitId -> Doc Source #
Pretty Module # |
Instance details Defined in Distribution.Types.Module Methods pretty :: Module -> Doc Source # prettyVersioned :: CabalSpecVersion -> Module -> Doc Source #
Pretty OpenModule # |
Instance details Defined in Distribution.Backpack Methods pretty :: OpenModule -> Doc Source # prettyVersioned :: CabalSpecVersion -> OpenModule -> Doc Source #
Pretty OpenUnitId # |
Instance details Defined in Distribution.Backpack Methods pretty :: OpenUnitId -> Doc Source # prettyVersioned :: CabalSpecVersion -> OpenUnitId -> Doc Source #
Pretty ExposedModule # |
Instance details Defined in Distribution.Types.ExposedModule Methods pretty :: ExposedModule -> Doc Source # prettyVersioned :: CabalSpecVersion -> ExposedModule -> Doc Source #
Pretty MungedPackageId # |
    >>> prettyShow $ MungedPackageId (MungedPackageName "servant" LMainLibName) (mkVersion [1,2,3])
    "servant-1.2.3"
    >>> prettyShow $ MungedPackageId (MungedPackageName "servant" (LSubLibName "lackey")) (mkVersion [0,1,2])
    "z-servant-z-lackey-0.1.2"
Instance details Defined in Distribution.Types.MungedPackageId Methods pretty :: MungedPackageId -> Doc Source # prettyVersioned :: CabalSpecVersion -> MungedPackageId -> Doc Source #
Pretty LegacyExeDependency # |
Instance details Defined in Distribution.Types.LegacyExeDependency Methods pretty :: LegacyExeDependency -> Doc Source # prettyVersioned :: CabalSpecVersion -> LegacyExeDependency -> Doc Source #
Pretty ExeDependency # |
Instance details Defined in Distribution.Types.ExeDependency Methods pretty :: ExeDependency -> Doc Source # prettyVersioned :: CabalSpecVersion -> ExeDependency -> Doc Source #
Pretty Dependency # |
Instance details Defined in Distribution.Types.Dependency Methods pretty :: Dependency -> Doc Source # prettyVersioned :: CabalSpecVersion -> Dependency -> Doc Source #
Pretty BenchmarkType # |
Instance details Defined in Distribution.Types.BenchmarkType Methods pretty :: BenchmarkType -> Doc Source # prettyVersioned :: CabalSpecVersion -> BenchmarkType -> Doc Source #
Pretty AbiDependency # |
Instance details Defined in Distribution.Types.AbiDependency Methods pretty :: AbiDependency -> Doc Source # prettyVersioned :: CabalSpecVersion -> AbiDependency -> Doc Source #
Pretty License # |
Instance details Defined in Distribution.License Methods pretty :: License -> Doc Source # prettyVersioned :: CabalSpecVersion -> License -> Doc Source #
Pretty KnownExtension # |
Instance details Defined in Language.Haskell.Extension Methods pretty :: KnownExtension -> Doc Source # prettyVersioned :: CabalSpecVersion -> KnownExtension -> Doc Source #
Pretty Extension # |
Instance details Defined in Language.Haskell.Extension Methods pretty :: Extension -> Doc Source # prettyVersioned :: CabalSpecVersion -> Extension -> Doc Source #
Pretty Language # |
Instance details Defined in Language.Haskell.Extension Methods pretty :: Language -> Doc Source # prettyVersioned :: CabalSpecVersion -> Language -> Doc Source #
Pretty AbiTag # |
Instance details Defined in Distribution.Compiler Methods pretty :: AbiTag -> Doc Source # prettyVersioned :: CabalSpecVersion -> AbiTag -> Doc Source #
Pretty CompilerId # |
Instance details Defined in Distribution.Compiler Methods pretty :: CompilerId -> Doc Source # prettyVersioned :: CabalSpecVersion -> CompilerId -> Doc Source #
Pretty CompilerFlavor # |
Instance details Defined in Distribution.Compiler Methods pretty :: CompilerFlavor -> Doc Source # prettyVersioned :: CabalSpecVersion -> CompilerFlavor -> Doc Source #
Pretty LibVersionInfo # |
Instance details Defined in Distribution.Types.ForeignLib Methods pretty :: LibVersionInfo -> Doc Source # prettyVersioned :: CabalSpecVersion -> LibVersionInfo -> Doc Source #
Pretty FlagName # |
Instance details Defined in Distribution.Types.GenericPackageDescription Methods pretty :: FlagName -> Doc Source # prettyVersioned :: CabalSpecVersion -> FlagName -> Doc Source #
Pretty FilePathNT # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: FilePathNT -> Doc Source # prettyVersioned :: CabalSpecVersion -> FilePathNT -> Doc Source #
Pretty TestedWith # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: TestedWith -> Doc Source # prettyVersioned :: CabalSpecVersion -> TestedWith -> Doc Source #
Pretty SpecLicense # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: SpecLicense -> Doc Source # prettyVersioned :: CabalSpecVersion -> SpecLicense -> Doc Source #
Pretty SpecVersion # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: SpecVersion -> Doc Source # prettyVersioned :: CabalSpecVersion -> SpecVersion -> Doc Source #
Pretty Token' # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: Token' -> Doc Source # prettyVersioned :: CabalSpecVersion -> Token' -> Doc Source #
Pretty Token # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: Token -> Doc Source # prettyVersioned :: CabalSpecVersion -> Token -> Doc Source #
Pretty TestShowDetails # |
Instance details Defined in Distribution.Simple.Setup Methods pretty :: TestShowDetails -> Doc Source # prettyVersioned :: CabalSpecVersion -> TestShowDetails -> Doc Source #
Pretty HaddockTarget # |
Instance details Defined in Distribution.Simple.Setup Methods pretty :: HaddockTarget -> Doc Source # prettyVersioned :: CabalSpecVersion -> HaddockTarget -> Doc Source #
Pretty a => Pretty (Identity a) # |
Instance details Defined in Distribution.Pretty Methods pretty :: Identity a -> Doc Source # prettyVersioned :: CabalSpecVersion -> Identity a -> Doc Source #
Pretty a => Pretty (MQuoted a) # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: MQuoted a -> Doc Source # prettyVersioned :: CabalSpecVersion -> MQuoted a -> Doc Source #
(Newtype a b, Sep sep, Pretty b) => Pretty (List sep b a) # |
Instance details Defined in Distribution.Parsec.Newtypes Methods pretty :: List sep b a -> Doc Source # prettyVersioned :: CabalSpecVersion -> List sep b a -> Doc Source #

prettyShow :: Pretty a => a -> String 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.

flatStyle :: Style Source #

A style for rendering all on one line.

# Utilities

showFilePath :: FilePath -> Doc Source #

showToken :: String -> Doc Source #

showFreeText :: String -> Doc Source #

Pretty-print free-format text, ensuring that it is vertically aligned, and with blank lines replaced by dots for correct re-parsing.

showFreeTextV3 :: String -> Doc Source #

Pretty-print free-format text. Since `cabal-version: 3.0` we don't replace blank lines with dots.

Since: Cabal-3.0.0.0

# Deprecated

type Separator = [Doc] -> Doc Source #