HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleCabal-syntax-3.12.1.0Haskell2010

Distribution.Pretty

  • 1 type
  • 1 class
  • 8 values
classclass Pretty a where
#

Methods

Instances81FieldGrammar, Pretty, …
  • Pretty OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Backpack
  • Pretty OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Backpack
  • Pretty AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.Compiler
  • Pretty CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.Compiler
  • Pretty CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Compiler
  • Pretty FilePathNTDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty SpecLicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty SpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty TestedWithDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty TokenDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty Token'Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.License
  • Pretty ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleName
  • Pretty CompatFilePathDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.FieldGrammar
  • Pretty CompatLicenseFileDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.FieldGrammar
  • Pretty LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.License
  • Pretty LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionId
  • Pretty LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpression
  • Pretty SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpression
  • Pretty LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseId
  • Pretty LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReference
  • Pretty ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.System
  • Pretty OSDefined in Cabal-syntax-3.12.1.0 · Distribution.System
  • Pretty PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.System
  • Pretty AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependency
  • Pretty AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHash
  • Pretty BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkType
  • Pretty BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildType
  • Pretty ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentId
  • Pretty ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentName
  • Pretty DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.Dependency
    Example1 expression
    prettyShow $ Dependency (mkPackageName "pkg") anyVersion mainLibSet"pkg"
    Example1 expression
    prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib") mainLibSet"pkg:{pkg, sublib}"
    Example1 expression
    prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib")"pkg:sublib"
    Example1 expression
    prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib-b") $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib-a")"pkg:{sublib-a, sublib-b}"
  • Pretty ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependency
  • Pretty ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScope
  • Pretty ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModule
  • Pretty FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.Flag
  • Pretty FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.Flag
  • Pretty LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLib
  • Pretty ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOption
  • Pretty ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibType
  • Pretty IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenaming
  • Pretty CompatPackageKeyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammar
  • Pretty ExposedModulesDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammar
  • Pretty InstWithDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammar
  • Pretty SpecLicenseLenientDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammar
  • Pretty LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependency
  • Pretty LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibility
  • Pretty MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.Mixin
  • Pretty ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.Module
  • Pretty ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexport
  • Pretty ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenaming
  • Pretty MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageId
    Example1 expression
    prettyShow $ MungedPackageId (MungedPackageName "servant" LMainLibName) (mkVersion [1,2,3])"servant-1.2.3"
    Example1 expression
    prettyShow $ MungedPackageId (MungedPackageName "servant" (LSubLibName "lackey")) (mkVersion [0,1,2])"z-servant-z-lackey-0.1.2"
  • Pretty MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.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!

    Example1 expression
    prettyShow $ MungedPackageName "servant" LMainLibName"servant"
    Example1 expression
    prettyShow $ MungedPackageName "servant" (LSubLibName "lackey")"z-servant-z-lackey"
  • Pretty PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageId
  • Pretty PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageName
  • Pretty PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraint
  • Pretty PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependency
  • Pretty PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigName
  • Pretty PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersion
  • Pretty PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRange
  • Pretty KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepo
  • Pretty RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepo
  • Pretty RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepo
  • Pretty TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestType
  • Pretty DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitId
  • Pretty UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitId

    The textual format for UnitId coincides with the format GHC accepts for -package-id.

  • Pretty UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentName
  • Pretty VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.Version
  • Pretty VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.Internal
    Example1 expression
    fmap pretty (simpleParsec' CabalSpecV1_6 "== 3.2.*" :: Maybe VersionRange)Just >=3.2 && <3.3
    Example1 expression
    fmap (prettyVersioned CabalSpecV1_6) (simpleParsec' CabalSpecV1_6 "== 3.2.*" :: Maybe VersionRange)Just ==3.2.*
    Example1 expression
    fmap pretty (simpleParsec' CabalSpecV1_6 "-any" :: Maybe VersionRange)Just >=0
    Example1 expression
    fmap (prettyVersioned CabalSpecV1_6) (simpleParsec' CabalSpecV1_6 "-any" :: Maybe VersionRange)Just >=0
  • Pretty ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.Extension
  • Pretty KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.Extension
  • Pretty LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.Extension
  • Pretty BoolDefined in Cabal-syntax-3.12.1.0 · Distribution.Pretty
  • Pretty IntDefined in Cabal-syntax-3.12.1.0 · Distribution.Pretty
  • Pretty DocDefined in Cabal-syntax-3.12.1.0 · Distribution.Pretty
  • FieldGrammar Pretty PrettyFieldGrammarDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Pretty
  • Pretty a => Pretty (MQuoted a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty a => Pretty (Identity a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Pretty
  • Pretty (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Path
  • (Newtype a b, Sep sep, Pretty b) => Pretty (List sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • (Newtype a b, Sep sep, Pretty b) => Pretty (NonEmpty' sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • (Newtype a b, Sep sep, Pretty b) => Pretty (Set' sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
valuedefaultStyle :: Style
#

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

Utilities

5 declarations
valueshowFreeText :: String -> Doc
#

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

valueshowFreeTextV3 :: String -> Doc
#

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

Deprecated

1 declaration