cabal-install-3.12.1.0: The command-line interface for Cabal and Hackage.

Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Client.Sandbox.PackageEnvironment

Description

Utilities for working with the package environment file. Patterned after Distribution.Client.Config.

Synopsis

- data PackageEnvironment = PackageEnvironment {
  - pkgEnvSavedConfig :: SavedConfig
  }
- data PackageEnvironmentType
  - = UserPackageEnvironment
  - | AmbientPackageEnvironment
- classifyPackageEnvironment :: FilePath -> IO PackageEnvironmentType
- readPackageEnvironmentFile :: ConstraintSource -> PackageEnvironment -> FilePath -> IO (Maybe (ParseResult PackageEnvironment))
- showPackageEnvironment :: PackageEnvironment -> String
- showPackageEnvironmentWithComments :: Maybe PackageEnvironment -> PackageEnvironment -> String
- loadUserConfig :: Verbosity -> FilePath -> Maybe FilePath -> IO SavedConfig
- userPackageEnvironmentFile :: FilePath

# Documentation

data PackageEnvironment #

Constructors

PackageEnvironment |

Fields

- pkgEnvSavedConfig :: SavedConfig

#### Instances

Instances details

Monoid PackageEnvironment # |
Instance details Defined in Distribution.Client.Sandbox.PackageEnvironment Methods mempty :: PackageEnvironment # mappend :: PackageEnvironment -> PackageEnvironment -> PackageEnvironment # mconcat :: [PackageEnvironment] -> PackageEnvironment #
Semigroup PackageEnvironment # |
Instance details Defined in Distribution.Client.Sandbox.PackageEnvironment Methods (<>) :: PackageEnvironment -> PackageEnvironment -> PackageEnvironment # sconcat :: NonEmpty PackageEnvironment -> PackageEnvironment # stimes :: Integral b => b -> PackageEnvironment -> PackageEnvironment #
Generic PackageEnvironment # |

Instance details

Defined in Distribution.Client.Sandbox.PackageEnvironment

Associated Types

type Rep PackageEnvironment |

Instance details

Defined in Distribution.Client.Sandbox.PackageEnvironment

type Rep PackageEnvironment = D1 ('MetaData "PackageEnvironment" "Distribution.Client.Sandbox.PackageEnvironment" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "PackageEnvironment" 'PrefixI 'True) (S1 ('MetaSel ('Just "pkgEnvSavedConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SavedConfig)))

Methods

from :: PackageEnvironment -> Rep PackageEnvironment x #

to :: Rep PackageEnvironment x -> PackageEnvironment #

type Rep PackageEnvironment # |

Instance details

Defined in Distribution.Client.Sandbox.PackageEnvironment

type Rep PackageEnvironment = D1 ('MetaData "PackageEnvironment" "Distribution.Client.Sandbox.PackageEnvironment" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "PackageEnvironment" 'PrefixI 'True) (S1 ('MetaSel ('Just "pkgEnvSavedConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SavedConfig)))

data PackageEnvironmentType #

Type of the current package environment.

Constructors

UserPackageEnvironment | './cabal.config'
AmbientPackageEnvironment | '~.configcabal/config'

classifyPackageEnvironment :: FilePath -> IO PackageEnvironmentType #

Is there a 'cabal.config' in this directory?

readPackageEnvironmentFile :: ConstraintSource -> PackageEnvironment -> FilePath -> IO (Maybe (ParseResult PackageEnvironment)) #

Read the package environment file.

showPackageEnvironment :: PackageEnvironment -> String #

Pretty-print the package environment.

showPackageEnvironmentWithComments :: Maybe PackageEnvironment -> PackageEnvironment -> String #

Pretty-print the package environment with default values for empty fields commented out (just like the default Cabal config file).

loadUserConfig :: Verbosity -> FilePath -> Maybe FilePath -> IO SavedConfig #

Same as `userPackageEnvironmentFile`, but returns a SavedConfig.

userPackageEnvironmentFile :: FilePath #

Optional package environment file that can be used to customize the default settings. Created by the user.