| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cabal.Config
Synopsis
- data Config f = 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
Very minimal representation of ~/.cabal/config file.
Constructors
| Config | |
Fields
| |
Instances
| Show (f FilePath) => Show (Config f) Source # | |
| Generic (Config f) Source # | |
| NFData (f FilePath) => NFData (Config f) Source # | Since: 0.2.1 |
Defined in Cabal.Config | |
| type Rep (Config f) Source # | |
Defined in Cabal.Config type Rep (Config f) = D1 (MetaData "Config" "Cabal.Config" "cabal-install-parsers-0.4-w4mTgtw0tJ6iqwagB75LL" 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 root-keys, key-threshold which we don't need now.
Constructors
| Repo | |
Fields
| |
Instances
| Show Repo Source # | |
| Generic 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.4-w4mTgtw0tJ6iqwagB75LL" 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 convinience 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/.