| 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 #
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 | |||||
| Binary ActiveRepos # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| NFData ActiveRepos # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods rnf :: ActiveRepos -> () # | |||||
| Generic ActiveRepos # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Associated Types
| |||||
| Show ActiveRepos # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods showsPrec :: Int -> ActiveRepos -> ShowS # show :: ActiveRepos -> String # showList :: [ActiveRepos] -> ShowS # | |||||
| 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.12.1.0-G554PkJj2SpDqyarXp9tbt" '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
| Parsec CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods parsec :: CabalParsing m => m CombineStrategy # | |||||
| Pretty CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods pretty :: CombineStrategy -> Doc # prettyVersioned :: CabalSpecVersion -> CombineStrategy -> Doc # | |||||
| Structured CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods structure :: Proxy CombineStrategy -> Structure # structureHash' :: Tagged CombineStrategy MD5 | |||||
| Binary CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods put :: CombineStrategy -> Put # get :: Get CombineStrategy # putList :: [CombineStrategy] -> Put # | |||||
| NFData CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods rnf :: CombineStrategy -> () # | |||||
| Bounded CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos | |||||
| Enum CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods succ :: CombineStrategy -> CombineStrategy # pred :: CombineStrategy -> CombineStrategy # toEnum :: Int -> CombineStrategy # fromEnum :: CombineStrategy -> Int # enumFrom :: CombineStrategy -> [CombineStrategy] # enumFromThen :: CombineStrategy -> CombineStrategy -> [CombineStrategy] # enumFromTo :: CombineStrategy -> CombineStrategy -> [CombineStrategy] # enumFromThenTo :: CombineStrategy -> CombineStrategy -> CombineStrategy -> [CombineStrategy] # | |||||
| Generic CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Associated Types
Methods from :: CombineStrategy -> Rep CombineStrategy x # to :: Rep CombineStrategy x -> CombineStrategy # | |||||
| Show CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods showsPrec :: Int -> CombineStrategy -> ShowS # show :: CombineStrategy -> String # showList :: [CombineStrategy] -> ShowS # | |||||
| Eq CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos Methods (==) :: CombineStrategy -> CombineStrategy -> Bool # (/=) :: CombineStrategy -> CombineStrategy -> Bool # | |||||
| type Rep CombineStrategy # | |||||
Defined in Distribution.Client.IndexUtils.ActiveRepos type Rep CombineStrategy = D1 ('MetaData "CombineStrategy" "Distribution.Client.IndexUtils.ActiveRepos" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "CombineStrategySkip" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CombineStrategyMerge" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CombineStrategyOverride" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
organizeByRepos :: 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 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.