HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecabal-install-3.12.1.0Haskell2010

Distribution.Client.CmdErrorMessages

Utilities to help format error messages for the various CLI commands.

  • 5 types
  • 23 values
valueplural :: Plural -> a -> a -> a
#

Used to render a singular or plural version of something

plural (listPlural theThings) "it is" "they are"
valuesortGroupOn :: Ord b => (a -> b) -> [a] -> [(b, [a])]
#

When rendering lists of things it often reads better to group related things, e.g. grouping components by package name

renderListSemiAnd
  [     "the package " ++ prettyShow pkgname ++ " components "
     ++ renderListCommaAnd showComponentName components
  | (pkgname, components) <- sortGroupOn packageName allcomponents ]
valuelistPlural :: [a] -> Plural
#

Singular for singleton lists and plural otherwise.

datadata TargetSelector
#

A target selector is expression selecting a set of components (as targets for a actions like build, run, test etc). A target selector corresponds to the user syntax for referring to targets on the command line.

From the users point of view a target can be many things: packages, dirs, component names, files etc. Internally we consider a target to be a specific component (or module/file within a component), and all the users' notions of targets are just different ways of referring to these component targets.

So target selectors are expressions in the sense that they are interpreted to refer to one or more components. For example a TargetPackage gets interpreted differently by different commands to refer to all or a subset of components within the package.

The syntax has lots of optional parts:

[ package name | package dir | package .cabal file ]
[ [lib:|exe:] component name ]
[ module name | source file ]

Constructors

Instances5Eq, Ord, Show, Generic, Rep
datadata SubComponentTarget
#

Either the component as a whole or detail about a file or module target within a component.

Constructors

Instances7Eq, Ord, Show, Generic, Binary, Structured, …