Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cabal.Config
Synopsis
- data Config (f :: Type -> Type) = Config {
- cfgRepositories :: Map RepoName Repo
- cfgRemoteRepoCache :: f FilePath
- cfgInstallDir :: f FilePath
- cfgStoreDir :: f FilePath
- data Repo = Repo {
- repoURL :: URI
- repoSecure :: Bool
- type RepoName = String
- readConfig :: IO (Config Identity)
- findConfig :: IO FilePath
- parseConfig :: FilePath -> ByteString -> Either (ParseError NonEmpty) (Config Maybe)
- resolveConfig :: Config Maybe -> IO (Config Identity)
- cfgRepoIndex :: Config Identity -> RepoName -> Maybe FilePath
- hackageHaskellOrg :: RepoName
Types
data Config (f :: Type -> Type) Source #
Very minimal representation of ~/.cabal/config
file.
Constructors
Config | |
Fields
|
Instances
Repository.
missing root-keys
, key-threshold
which we don't need now.
Constructors
Repo | |
Fields
|
Instances
Generic Repo Source # | |||||
Defined in Cabal.Config Associated Types
| |||||
Show Repo Source # | |||||
NFData Repo Source # | Since: 0.2.1 | ||||
Defined in Cabal.Config | |||||
type Rep Repo Source # | |||||
Defined in Cabal.Config type Rep Repo = D1 ('MetaData "Repo" "Cabal.Config" "cabal-install-parsers-0.6.1.1-ITUSJqqfbs0JK5ThCd6jVn" 'False) (C1 ('MetaCons "Repo" 'PrefixI 'True) (S1 ('MetaSel ('Just "repoURL") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 URI) :*: S1 ('MetaSel ('Just "repoSecure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
Parsing
readConfig :: IO (Config Identity) Source #
High level convenience function to find and read ~/.cabal/config
file
May throw IOException
when file doesn't exist, and ParseError
on parse error.
findConfig :: IO FilePath Source #
Find the ~/.cabal/config
file.
parseConfig :: FilePath -> ByteString -> Either (ParseError NonEmpty) (Config Maybe) Source #
Parse ~/.cabal/config
file.
resolveConfig :: Config Maybe -> IO (Config Identity) Source #
Fill the default in ~/.cabal/config
file.
Hackage
cfgRepoIndex :: Config Identity -> RepoName -> Maybe FilePath Source #
Find a 01-index.tar
for particular repository
hackageHaskellOrg :: RepoName Source #
The default repository of haskell packages, https://hackage.haskell.org/.