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-3.12.1.0Haskell2010

Distribution.Simple.Setup

This module defines the command line interface for all the Cabal commands. For each command (like configure, build etc) it defines a type that holds all the flags, the default set of flags and a CommandUI that maps command line flags to and from the corresponding flags type.

All the flags types are instances of Monoid, see http://www.haskell.org/pipermail/cabal-devel/2007-December/001509.html for an explanation.

The types defined here get used in the front end and especially in cabal-install which has to do quite a bit of manipulating sets of command line flags.

This is actually relatively nice, it works quite well. The main change it needs is to unify it with the code for managing sets of fields that can be read and written from files. This would allow us to save configure flags in config files.

  • 22 types
  • 1 class
  • 78 values
  • PackageCabal-3.12.1.0
  • Exports101
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSetup.hs
datadata GlobalFlags
#

Flags that apply at the top level, not to any sub-command.

Instances4Generic, Semigroup, Monoid, Rep
datadata ConfigFlags
#

Flags to configure command.

IMPORTANT: every time a new flag is added, D.C.Setup.filterConfigureFlags should be updated. IMPORTANT: every time a new flag is added, it should be added to the Eq instance

Constructors

Instances9Eq, Read, Show, Generic, Semigroup, Monoid, …
datadata CopyFlags
#

Flags to copy: (destdir, copy-prefix (backwards compat), verbosity)

Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata InstallFlags
#
Instances5Show, Generic, Semigroup, Monoid, Rep
datadata HaddockTarget
#

When we build haddock documentation, there are two cases:

  1. We build haddocks only for the current development version, intended for local use and not for distribution. In this case, we store the generated documentation in distdochtml/name.

  2. We build haddocks for intended for uploading them to hackage. In this case, we need to follow the layout that hackage expects from documentation tarballs, and we might also want to use different flags than for development builds, so in this case we store the generated documentation in distdochtml/id-docs.

Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …
datadata HaddockFlags
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata Visibility
#

Governs whether modules from a given interface should be visible or hidden in the Haddock generated content page. We don't expose this functionality to the user, but simply use Visible for only local packages. Visibility of modules is available since haddock-2.26.1.

Instances2Eq, Show
  • Eq VisibilityDefined in Cabal-3.12.1.0 · Distribution.Simple.Setup.Haddock
  • Show VisibilityDefined in Cabal-3.12.1.0 · Distribution.Simple.Setup.Haddock
datadata HaddockProjectFlags
#
Instances5Show, Generic, Semigroup, Monoid, Rep
datadata HscolourFlags
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata BuildFlags
#
Instances8Read, Show, Generic, Semigroup, Monoid, Binary, …
datadata DumpBuildInfo
#
Instances10Bounded, Enum, Eq, Ord, Read, Show, …
datadata ReplFlags
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata ReplOptions
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata CleanFlags
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata RegisterFlags
#

Flags to register and unregister: (user package, gen-script, in-place, verbosity)

Instances5Show, Generic, Semigroup, Monoid, Rep
datadata SDistFlags
#
Instances5Show, Generic, Semigroup, Monoid, Rep
datadata TestFlags
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata TestShowDetails
#
Instances13Bounded, Enum, Eq, Ord, Show, Generic, …
datadata BenchmarkFlags
#
Instances7Show, Generic, Semigroup, Monoid, Binary, Structured, …
datadata CopyDest
#

The location prefix for the copy command.

Constructors

Instances6Eq, Show, Generic, Binary, Structured, Rep
valuesplitArgs :: String -> [String]
#

Helper function to split a string into a list of arguments. It's supposed to handle quoted things sensibly, eg:

splitArgs "--foo=\"C:/Program Files/Bar/" --baz"
  = ["--foo=C:/Program Files/Bar", "--baz"]
splitArgs "\"-DMSGSTR=\\\"foo bar\\\"\" --baz"
  = ["-DMSGSTR=\"foo bar\"","--baz"]
datadata Flag a
#

All flags are monoids, they come in two flavours:

  1. list flags eg

--ghc-option=foo --ghc-option=bar

gives us all the values ["foo", "bar"]

  1. singular value flags, eg:

--enable-foo --disable-foo

gives us Just False

So, this Flag type is for the latter singular kind of flag. Its monoid instance gives us the behaviour where it starts out as NoFlag and later flags override earlier ones.

Isomorphic to Maybe a.

Constructors

Instances15Functor, Applicative, Foldable, Traversable, Bounded, Enum, …
classclass BooleanFlag a where
#

Types that represent boolean flags.

Methods

Instances1BooleanFlag
datadata BuildingWhat
#

What kind of build are we doing?

Is this a normal build, or is it perhaps for running an interactive session or Haddock?

Constructors

Instances3Show, Generic, Rep