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.ProjectConfig.Types

Handling project configuration, types.

  • 12 types
  • 1 value

Types for project config

6 declarations
datadata ProjectConfig
#

This type corresponds directly to what can be written in the cabal.project file. Other sources of configuration can also be injected into this type, such as the user-wide config file and the command line of cabal configure or cabal build.

Since it corresponds to the external project file it is an instance of Monoid and all the fields can be empty. This also means there has to be a step where we resolve configuration. At a minimum resolving means applying defaults but it can also mean merging information from multiple sources. For example for package-specific configuration the project file can specify configuration that applies to all local packages, and then additional configuration for a specific package.

Future directions: multiple profiles, conditionals. If we add these features then the gap between configuration as written in the config file and resolved settings we actually use will become even bigger.

Constructors

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …
newtypenewtype ProjectConfigToParse
#

The project configuration is configuration that is parsed but parse configuration may import more configuration. Holds the unparsed contents of an imported file contributing to the project config.

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …
datadata ProjectConfigShared
#

Project configuration that is shared between all packages in the project. In particular this includes configuration that affects the solver.

Constructors

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …

Specifies the provenance of project configuration, whether defaults were used or if the configuration was read from an explicit file path.

Constructors

Instances7Eq, Ord, Show, Generic, Binary, Structured, …
datadata PackageConfig
#

Project configuration that is specific to each package, that is where we can in principle have different values for different packages in the same project.

Constructors

Instances8Eq, Show, Generic, Semigroup, Monoid, Binary, …

Resolving configuration

5 declarations
datadata SolverSettings
#
Instances6Eq, Show, Generic, Binary, Structured, Rep
datadata BuildTimeSettings
#

Resolved configuration for things that affect how we build and not the value of the things we build. The idea is that this is easier to use than the raw configuration because in the raw configuration everything is optional (monoidial). In the BuildTimeSettings every field is filled in, if only with the defaults.

Use resolveBuildTimeSettings to make one from the project config (by applying defaults etc).

datadata ParStratX sem
#

How to control parallelism, e.g. a fixed number of jobs or by using a system semaphore.

Constructors

  • NumJobs (Maybe Int)

    Compile in parallel with the given number of jobs (`-jN` or `-j`).

  • UseSem sem

    `--semaphore`: use a system semaphore to control parallelism.

  • Serial

    No parallelism (neither `-jN` nor `--semaphore`, but could be `-j1`).

Instances1Show
  • Show sem => Show (ParStratX sem)Defined in Cabal-3.12.1.0 · Distribution.Types.ParStrat
typetype ParStrat = ParStratX String
#

Used by Cabal to indicate that we want to use this specific semaphore (created by cabal-install)

Extra useful Monoids

2 declarations
newtypenewtype MapLast k v
#

Newtype wrapper for Map that provides a Monoid instance that takes the last value rather than the first value for overlapping keys.

Constructors

Instances9Functor, Eq, Show, Generic, Semigroup, Monoid, …
newtypenewtype MapMappend k v
#

Newtype wrapper for Map that provides a Monoid instance that mappends values of overlapping keys rather than taking the first.

Constructors

Instances9Functor, Eq, Show, Generic, Semigroup, Monoid, …