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 | |||||
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 # | |||||
Binary ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
NFData ActiveRepos Source # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods rnf :: ActiveRepos -> () # | |||||
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.10.2.1-EO08dQqJlJ1LA93BcH17VX" '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 | |||||
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 # | |||||
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 -> () # | |||||
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.10.2.1-EO08dQqJlJ1LA93BcH17VX" '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 repos
Right [(RepoName "a",CombineStrategyMerge),(RepoName "b",CombineStrategyMerge),(RepoName "c",CombineStrategyMerge)]
>>>
organizeByRepos (ActiveRepos [ActiveRepo (RepoName "b") CombineStrategyOverride, ActiveRepoRest CombineStrategyMerge]) id repos
Right [(RepoName "b",CombineStrategyOverride),(RepoName "a",CombineStrategyMerge),(RepoName "c",CombineStrategyMerge)]
>>>
organizeByRepos (ActiveRepos [ActiveRepoRest CombineStrategyMerge, ActiveRepo (RepoName "b") CombineStrategyOverride]) id repos
Right [(RepoName "a",CombineStrategyMerge),(RepoName "c",CombineStrategyMerge),(RepoName "b",CombineStrategyOverride)]
>>>
organizeByRepos (ActiveRepos [ActiveRepoRest CombineStrategyMerge, ActiveRepo (RepoName "d") CombineStrategyOverride]) id repos
Left "no repository provided d"
Note: currently if ActiveRepoRest
is provided more than once,
rest-repositories will be multiple times in the output.