Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Config f = Config {
- cfgRepositories :: Map RepoName Repo
- cfgRemoteRepoCache :: f FilePath
- cfgInstallDir :: f FilePath
- cfgStoreDir :: f FilePath
- newtype Repo = Repo {}
- type RepoName = String
- readConfig :: IO (Config Identity)
- findConfig :: IO FilePath
- parseConfig :: FilePath -> ByteString -> Either ParseError (Config Maybe)
- resolveConfig :: Config Maybe -> IO (Config Identity)
- cfgRepoIndex :: Config Identity -> RepoName -> Maybe FilePath
- hackageHaskellOrg :: RepoName
Types
Very minimal representation of ~/.cabal/config
file.
Config | |
|
Instances
Show (f FilePath) => Show (Config f) Source # | |
Generic (Config f) Source # | |
type Rep (Config f) Source # | |
Defined in Cabal.Config type Rep (Config f) = D1 (MetaData "Config" "Cabal.Config" "cabal-install-parsers-0.1-KnbyjwSF8DJ8ZqXrXIKJWN" False) (C1 (MetaCons "Config" PrefixI True) ((S1 (MetaSel (Just "cfgRepositories") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map RepoName Repo)) :*: S1 (MetaSel (Just "cfgRemoteRepoCache") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f FilePath))) :*: (S1 (MetaSel (Just "cfgInstallDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f FilePath)) :*: S1 (MetaSel (Just "cfgStoreDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f FilePath))))) |
Repository.
missing secure
, root-keys
, key-threshold
which we don't need now.
Parsing
readConfig :: IO (Config Identity) Source #
High level convinience function to find and read ~.cabalconfig
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 (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/.