| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Client.IndexUtils.ActiveRepos
Synopsis
- newtype ActiveRepos = ActiveRepos [ActiveRepoEntry]
- defaultActiveRepos :: ActiveRepos
- filterSkippedActiveRepos :: ActiveRepos -> ActiveRepos
- data ActiveRepoEntry
- data CombineStrategy
- organizeByRepos :: ActiveRepos -> (a -> RepoName) -> [a] -> Either String [(a, CombineStrategy)]
Documentation
newtype ActiveRepos Source #
Ordered list of active repositories.
Constructors
| ActiveRepos [ActiveRepoEntry] |
Instances
| Parsec ActiveRepos Source # | Note: empty string is not valid
| ||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods parsec :: CabalParsing m => m ActiveRepos # | |||||
| Pretty ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| Structured ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| Binary ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| NFData ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods rnf :: ActiveRepos -> () # | |||||
| Generic ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Associated Types
| |||||
| Show ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods showsPrec :: Int -> ActiveRepos -> ShowS # show :: ActiveRepos -> String # showList :: [ActiveRepos] -> ShowS # | |||||
| Eq ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| type Rep ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos type Rep ActiveRepos = D1 ('MetaData "ActiveRepos" "Distribution.Client.IndexUtils.ActiveRepos" "cabal-install-3.12.1.0-AEyM1PDTd3sCnSdrWcebY5" 'True) (C1 ('MetaCons "ActiveRepos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ActiveRepoEntry]))) | |||||
filterSkippedActiveRepos :: ActiveRepos -> ActiveRepos Source #
Note, this does nothing if ActiveRepoRest is present.
data ActiveRepoEntry Source #
Constructors
| ActiveRepoRest CombineStrategy | rest repositories, i.e. not explicitly listed as |
| ActiveRepo RepoName CombineStrategy | explicit repository name |
Instances
| Parsec ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods parsec :: CabalParsing m => m ActiveRepoEntry # | |||||
| Pretty ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods pretty :: ActiveRepoEntry -> Doc # prettyVersioned :: CabalSpecVersion -> ActiveRepoEntry -> Doc # | |||||
| Structured ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| Binary ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods put :: ActiveRepoEntry -> Put # get :: Get ActiveRepoEntry # putList :: [ActiveRepoEntry] -> Put # | |||||
| NFData ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods rnf :: ActiveRepoEntry -> () # | |||||
| Generic ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Associated Types
Methods from :: ActiveRepoEntry -> Rep ActiveRepoEntry x to :: Rep ActiveRepoEntry x -> ActiveRepoEntry | |||||
| Show ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods showsPrec :: Int -> ActiveRepoEntry -> ShowS # show :: ActiveRepoEntry -> String # showList :: [ActiveRepoEntry] -> ShowS # | |||||
| Eq ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods (==) :: ActiveRepoEntry -> ActiveRepoEntry -> Bool # (/=) :: ActiveRepoEntry -> ActiveRepoEntry -> Bool # | |||||
| type Rep ActiveRepoEntry Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos type Rep ActiveRepoEntry = D1 ('MetaData "ActiveRepoEntry" "Distribution.Client.IndexUtils.ActiveRepos" "cabal-install-3.12.1.0-AEyM1PDTd3sCnSdrWcebY5" 'False) (C1 ('MetaCons "ActiveRepoRest" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CombineStrategy)) :+: C1 ('MetaCons "ActiveRepo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RepoName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CombineStrategy))) | |||||
data CombineStrategy Source #
Constructors
| CombineStrategySkip | skip this repository |
| CombineStrategyMerge | merge existing versions |
| CombineStrategyOverride | if later repository specifies a package, all package versions are replaced |
Instances
organizeByRepos :: ActiveRepos -> (a -> RepoName) -> [a] -> Either String [(a, CombineStrategy)] Source #
Sort values RepoName according to ActiveRepos list.
>>>let repos = [RepoName "a", RepoName "b", RepoName "c"]>>>organizeByRepos (ActiveRepos [ActiveRepoRest CombineStrategyMerge]) id reposRight [(RepoName {unRepoName = "a"},CombineStrategyMerge),(RepoName {unRepoName = "b"},CombineStrategyMerge),(RepoName {unRepoName = "c"},CombineStrategyMerge)]
>>>organizeByRepos (ActiveRepos [ActiveRepo (RepoName "b") CombineStrategyOverride, ActiveRepoRest CombineStrategyMerge]) id reposRight [(RepoName {unRepoName = "b"},CombineStrategyOverride),(RepoName {unRepoName = "a"},CombineStrategyMerge),(RepoName {unRepoName = "c"},CombineStrategyMerge)]
>>>organizeByRepos (ActiveRepos [ActiveRepoRest CombineStrategyMerge, ActiveRepo (RepoName "b") CombineStrategyOverride]) id reposRight [(RepoName {unRepoName = "a"},CombineStrategyMerge),(RepoName {unRepoName = "c"},CombineStrategyMerge),(RepoName {unRepoName = "b"},CombineStrategyOverride)]
>>>organizeByRepos (ActiveRepos [ActiveRepoRest CombineStrategyMerge, ActiveRepo (RepoName "d") CombineStrategyOverride]) id reposLeft "no repository provided d"
Note: currently if ActiveRepoRest is provided more than once,
rest-repositories will be multiple times in the output.