Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Distribution.Client.IndexUtils.ActiveRepos
Synopsis
- newtype ActiveRepos = ActiveRepos [ActiveRepoEntry]
- defaultActiveRepos :: ActiveRepos
- filterSkippedActiveRepos :: ActiveRepos -> ActiveRepos
- data ActiveRepoEntry
- data CombineStrategy
- organizeByRepos :: forall a. ActiveRepos -> (a -> RepoName) -> [a] -> Either String [(a, CombineStrategy)]
Documentation
newtype ActiveRepos #
Ordered list of active repositories.
Constructors
ActiveRepos [ActiveRepoEntry] |
Instances
Parsec ActiveRepos # | Note: empty string is not valid
|
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods parsec :: CabalParsing m => m ActiveRepos # | |
Pretty ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos | |
Structured ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos | |
Generic ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos Associated Types type Rep ActiveRepos :: Type -> Type | |
Show ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods showsPrec :: Int -> ActiveRepos -> ShowS # show :: ActiveRepos -> String # showList :: [ActiveRepos] -> ShowS # | |
Binary ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos | |
NFData ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods rnf :: ActiveRepos -> () # | |
Eq ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos | |
type Rep ActiveRepos # | |
Defined in Distribution.Client.IndexUtils.ActiveRepos type Rep ActiveRepos = D1 ('MetaData "ActiveRepos" "Distribution.Client.IndexUtils.ActiveRepos" "cabal-install-3.10.1.0-Ekg8GNNGONdHi9WRJ3K3Tf" 'True) (C1 ('MetaCons "ActiveRepos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ActiveRepoEntry]))) |
filterSkippedActiveRepos :: ActiveRepos -> ActiveRepos #
Note, this does nothing if ActiveRepoRest
is present.
data ActiveRepoEntry #
Constructors
ActiveRepoRest CombineStrategy | rest repositories, i.e. not explicitly listed as |
ActiveRepo RepoName CombineStrategy | explicit repository name |
Instances
data CombineStrategy #
Constructors
CombineStrategySkip | skip this repository |
CombineStrategyMerge | merge existing versions |
CombineStrategyOverride | if later repository specifies a package, all package versions are replaced |
Instances
organizeByRepos :: forall a. ActiveRepos -> (a -> RepoName) -> [a] -> Either String [(a, CombineStrategy)] #
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.