Cabal-3.6.3.0: A framework for packaging Haskell software
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Pretty

Synopsis

Documentation

class Pretty a where Source #

Minimal complete definition

pretty

Instances

Instances details
Pretty Bool Source # 
Instance details

Defined in Distribution.Pretty

Pretty Int Source # 
Instance details

Defined in Distribution.Pretty

Pretty Doc Source #

Since: 3.4.0.0

Instance details

Defined in Distribution.Pretty

Pretty Version Source # 
Instance details

Defined in Distribution.Types.Version

Pretty VersionRange Source #
>>> fmap pretty (simpleParsec' CabalSpecV1_6 "== 3.2.*" :: Maybe VersionRange)
Just >=3.2 && <3.3
>>> fmap (prettyVersioned CabalSpecV1_6) (simpleParsec' CabalSpecV1_6 "== 3.2.*" :: Maybe VersionRange)
Just ==3.2.*
>>> fmap pretty (simpleParsec' CabalSpecV1_6 "-any" :: Maybe VersionRange)
Just >=0
>>> fmap (prettyVersioned CabalSpecV1_6) (simpleParsec' CabalSpecV1_6 "-any" :: Maybe VersionRange)
Just >=0
Instance details

Defined in Distribution.Types.VersionRange.Internal

Pretty RepoType Source # 
Instance details

Defined in Distribution.Types.SourceRepo

Pretty KnownRepoType Source # 
Instance details

Defined in Distribution.Types.SourceRepo

Pretty RepoKind Source # 
Instance details

Defined in Distribution.Types.SourceRepo

Pretty PkgconfigVersion Source # 
Instance details

Defined in Distribution.Types.PkgconfigVersion

Pretty PkgconfigVersionRange Source # 
Instance details

Defined in Distribution.Types.PkgconfigVersionRange

Pretty PkgconfigName Source # 
Instance details

Defined in Distribution.Types.PkgconfigName

Pretty PkgconfigDependency Source # 
Instance details

Defined in Distribution.Types.PkgconfigDependency

Pretty PackageName Source # 
Instance details

Defined in Distribution.Types.PackageName

Pretty UnqualComponentName Source # 
Instance details

Defined in Distribution.Types.UnqualComponentName

Pretty LibraryVisibility Source # 
Instance details

Defined in Distribution.Types.LibraryVisibility

Pretty MungedPackageName Source #

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

Pretty ForeignLibType Source # 
Instance details

Defined in Distribution.Types.ForeignLibType

Pretty ForeignLibOption Source # 
Instance details

Defined in Distribution.Types.ForeignLibOption

Pretty FlagAssignment Source #

Since: 3.4.0.0

Instance details

Defined in Distribution.Types.Flag

Pretty FlagName Source # 
Instance details

Defined in Distribution.Types.Flag

Pretty ExecutableScope Source # 
Instance details

Defined in Distribution.Types.ExecutableScope

Pretty ComponentName Source # 
Instance details

Defined in Distribution.Types.ComponentName

Pretty ComponentId Source # 
Instance details

Defined in Distribution.Types.ComponentId

Pretty BuildType Source # 
Instance details

Defined in Distribution.Types.BuildType

Pretty AbiHash Source # 
Instance details

Defined in Distribution.Types.AbiHash

Pretty Platform Source # 
Instance details

Defined in Distribution.System

Pretty Arch Source # 
Instance details

Defined in Distribution.System

Pretty OS Source # 
Instance details

Defined in Distribution.System

Pretty LicenseRef Source # 
Instance details

Defined in Distribution.SPDX.LicenseReference

Pretty LicenseId Source # 
Instance details

Defined in Distribution.SPDX.LicenseId

Pretty LicenseExceptionId Source # 
Instance details

Defined in Distribution.SPDX.LicenseExceptionId

Pretty SimpleLicenseExpression Source # 
Instance details

Defined in Distribution.SPDX.LicenseExpression

Pretty LicenseExpression Source # 
Instance details

Defined in Distribution.SPDX.LicenseExpression

Pretty License Source # 
Instance details

Defined in Distribution.SPDX.License

Pretty ModuleName Source # 
Instance details

Defined in Distribution.ModuleName

Pretty ModuleRenaming Source # 
Instance details

Defined in Distribution.Types.ModuleRenaming

Pretty IncludeRenaming Source # 
Instance details

Defined in Distribution.Types.IncludeRenaming

Pretty Mixin Source # 
Instance details

Defined in Distribution.Types.Mixin

Pretty ModuleReexport Source # 
Instance details

Defined in Distribution.Types.ModuleReexport

Pretty Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Pretty TestType Source # 
Instance details

Defined in Distribution.Types.TestType

Pretty PackageIdentifier Source # 
Instance details

Defined in Distribution.Types.PackageId

Pretty DefUnitId Source # 
Instance details

Defined in Distribution.Types.UnitId

Pretty UnitId Source #

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

Instance details

Defined in Distribution.Types.UnitId

Pretty Module Source # 
Instance details

Defined in Distribution.Types.Module

Pretty OpenModule Source # 
Instance details

Defined in Distribution.Backpack

Pretty OpenUnitId Source # 
Instance details

Defined in Distribution.Backpack

Pretty ExposedModule Source # 
Instance details

Defined in Distribution.Types.ExposedModule

Pretty PackageVersionConstraint Source # 
Instance details

Defined in Distribution.Types.PackageVersionConstraint

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

Pretty LegacyExeDependency Source # 
Instance details

Defined in Distribution.Types.LegacyExeDependency

Pretty ExeDependency Source # 
Instance details

Defined in Distribution.Types.ExeDependency

Pretty Dependency Source #
>>> prettyShow $ Dependency "pkg" anyVersion mainLibSet
"pkg"
>>> prettyShow $ Dependency "pkg" anyVersion $ NES.insert (LSubLibName "sublib") mainLibSet
"pkg:{pkg, sublib}"
>>> prettyShow $ Dependency "pkg" anyVersion $ NES.singleton (LSubLibName "sublib")
"pkg:sublib"
>>> prettyShow $ Dependency "pkg" anyVersion $ NES.insert (LSubLibName "sublib-b") $ NES.singleton (LSubLibName "sublib-a")
"pkg:{sublib-a, sublib-b}"
Instance details

Defined in Distribution.Types.Dependency

Pretty BenchmarkType Source # 
Instance details

Defined in Distribution.Types.BenchmarkType

Pretty AbiDependency Source # 
Instance details

Defined in Distribution.Types.AbiDependency

Pretty License Source # 
Instance details

Defined in Distribution.License

Pretty KnownExtension Source # 
Instance details

Defined in Language.Haskell.Extension

Pretty Extension Source # 
Instance details

Defined in Language.Haskell.Extension

Pretty Language Source # 
Instance details

Defined in Language.Haskell.Extension

Pretty AbiTag Source # 
Instance details

Defined in Distribution.Compiler

Pretty CompilerId Source # 
Instance details

Defined in Distribution.Compiler

Pretty CompilerFlavor Source # 
Instance details

Defined in Distribution.Compiler

Pretty LibVersionInfo Source # 
Instance details

Defined in Distribution.Types.ForeignLib

Pretty TestedWith Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty SpecLicense Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty SpecVersion Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty FilePathNT Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty Token' Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty Token Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty TestShowDetails Source # 
Instance details

Defined in Distribution.Simple.Setup

Pretty HaddockTarget Source # 
Instance details

Defined in Distribution.Simple.Setup

FieldGrammar Pretty PrettyFieldGrammar Source # 
Instance details

Defined in Distribution.FieldGrammar.Pretty

Methods

blurFieldGrammar :: ALens' a b -> PrettyFieldGrammar b d -> PrettyFieldGrammar a d Source #

uniqueFieldAla :: (Pretty b, Newtype a b) => FieldName -> (a -> b) -> ALens' s a -> PrettyFieldGrammar s a Source #

booleanFieldDef :: FieldName -> ALens' s Bool -> Bool -> PrettyFieldGrammar s Bool Source #

optionalFieldAla :: (Pretty b, Newtype a b) => FieldName -> (a -> b) -> ALens' s (Maybe a) -> PrettyFieldGrammar s (Maybe a) Source #

optionalFieldDefAla :: (Pretty b, Newtype a b, Eq a) => FieldName -> (a -> b) -> ALens' s a -> a -> PrettyFieldGrammar s a Source #

freeTextField :: FieldName -> ALens' s (Maybe String) -> PrettyFieldGrammar s (Maybe String) Source #

freeTextFieldDef :: FieldName -> ALens' s String -> PrettyFieldGrammar s String Source #

freeTextFieldDefST :: FieldName -> ALens' s ShortText -> PrettyFieldGrammar s ShortText Source #

monoidalFieldAla :: (Pretty b, Monoid a, Newtype a b) => FieldName -> (a -> b) -> ALens' s a -> PrettyFieldGrammar s a Source #

prefixedFields :: FieldName -> ALens' s [(String, String)] -> PrettyFieldGrammar s [(String, String)] Source #

knownField :: FieldName -> PrettyFieldGrammar s () Source #

hiddenField :: PrettyFieldGrammar s a -> PrettyFieldGrammar s a Source #

deprecatedSince :: CabalSpecVersion -> String -> PrettyFieldGrammar s a -> PrettyFieldGrammar s a Source #

removedIn :: CabalSpecVersion -> String -> PrettyFieldGrammar s a -> PrettyFieldGrammar s a Source #

availableSince :: CabalSpecVersion -> a -> PrettyFieldGrammar s a -> PrettyFieldGrammar s a Source #

availableSinceWarn :: CabalSpecVersion -> PrettyFieldGrammar s a -> PrettyFieldGrammar s a Source #

Pretty a => Pretty (Identity a) Source # 
Instance details

Defined in Distribution.Pretty

Pretty a => Pretty (MQuoted a) Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Pretty (SymbolicPath from to) Source # 
Instance details

Defined in Distribution.Utils.Path

(Newtype a b, Sep sep, Pretty b) => Pretty (NonEmpty' sep b a) Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

(Newtype a b, Sep sep, Pretty b) => Pretty (Set' sep b a) Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Methods

pretty :: Set' sep b a -> Doc Source #

prettyVersioned :: CabalSpecVersion -> Set' sep b a -> Doc Source #

(Newtype a b, Sep sep, Pretty b) => Pretty (List sep b a) Source # 
Instance details

Defined in Distribution.FieldGrammar.Newtypes

Methods

pretty :: List sep b a -> Doc Source #

prettyVersioned :: CabalSpecVersion -> List sep b a -> Doc 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

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: 3.0.0.0

Deprecated

type Separator = [Doc] -> Doc Source #