Safe Haskell | None |
---|---|
Language | Haskell2010 |
Distribution.Solver.Types.ComponentDeps
Description
Fine-grained package dependencies
Like many others, this module is meant to be "double-imported":
import Distribution.Solver.Types.ComponentDeps ( Component , ComponentDep , ComponentDeps ) import qualified Distribution.Solver.Types.ComponentDeps as CD
Synopsis
- data Component
- = ComponentLib
- | ComponentSubLib UnqualComponentName
- | ComponentFLib UnqualComponentName
- | ComponentExe UnqualComponentName
- | ComponentTest UnqualComponentName
- | ComponentBench UnqualComponentName
- | ComponentSetup
- componentNameToComponent :: ComponentName -> Component
- type ComponentDep a = (Component, a)
- data ComponentDeps a
- empty :: ComponentDeps a
- fromList :: Monoid a => [ComponentDep a] -> ComponentDeps a
- singleton :: Component -> a -> ComponentDeps a
- insert :: Monoid a => Component -> a -> ComponentDeps a -> ComponentDeps a
- zip :: (Monoid a, Monoid b) => ComponentDeps a -> ComponentDeps b -> ComponentDeps (a, b)
- filterDeps :: (Component -> a -> Bool) -> ComponentDeps a -> ComponentDeps a
- mapDeps :: (Component -> a -> b) -> ComponentDeps a -> ComponentDeps b
- fromLibraryDeps :: a -> ComponentDeps a
- fromSetupDeps :: a -> ComponentDeps a
- fromInstalled :: a -> ComponentDeps a
- toList :: ComponentDeps a -> [ComponentDep a]
- flatDeps :: Monoid a => ComponentDeps a -> a
- nonSetupDeps :: Monoid a => ComponentDeps a -> a
- libraryDeps :: Monoid a => ComponentDeps a -> a
- setupDeps :: Monoid a => ComponentDeps a -> a
- select :: Monoid a => (Component -> Bool) -> ComponentDeps a -> a
- components :: ComponentDeps a -> Set Component
Fine-grained package dependencies
Component of a package.
Constructors
ComponentLib | |
ComponentSubLib UnqualComponentName | |
ComponentFLib UnqualComponentName | |
ComponentExe UnqualComponentName | |
ComponentTest UnqualComponentName | |
ComponentBench UnqualComponentName | |
ComponentSetup |
Instances
Pretty Component Source # | |||||
Defined in Distribution.Solver.Types.ComponentDeps | |||||
Structured Component Source # | |||||
Defined in Distribution.Solver.Types.ComponentDeps | |||||
Binary Component Source # | |||||
Generic Component Source # | |||||
Defined in Distribution.Solver.Types.ComponentDeps Associated Types
| |||||
Show Component Source # | |||||
Eq Component Source # | |||||
Ord Component Source # | |||||
Defined in Distribution.Solver.Types.ComponentDeps | |||||
type Rep Component Source # | |||||
Defined in Distribution.Solver.Types.ComponentDeps type Rep Component = D1 ('MetaData "Component" "Distribution.Solver.Types.ComponentDeps" "cabal-install-solver-3.12.1.0-6QtTVKRIY4S7ZjmdXCyvm4" 'False) ((C1 ('MetaCons "ComponentLib" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ComponentSubLib" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnqualComponentName)) :+: C1 ('MetaCons "ComponentFLib" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnqualComponentName)))) :+: ((C1 ('MetaCons "ComponentExe" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnqualComponentName)) :+: C1 ('MetaCons "ComponentTest" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnqualComponentName))) :+: (C1 ('MetaCons "ComponentBench" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnqualComponentName)) :+: C1 ('MetaCons "ComponentSetup" 'PrefixI 'False) (U1 :: Type -> Type)))) |
componentNameToComponent :: ComponentName -> Component Source #
type ComponentDep a = (Component, a) Source #
Dependency for a single component.
data ComponentDeps a Source #
Fine-grained dependencies for a package.
Typically used as ComponentDeps [Dependency]
, to represent the list of
dependencies for each named component within a package.
Instances
Constructing ComponentDeps
empty :: ComponentDeps a Source #
fromList :: Monoid a => [ComponentDep a] -> ComponentDeps a Source #
singleton :: Component -> a -> ComponentDeps a Source #
insert :: Monoid a => Component -> a -> ComponentDeps a -> ComponentDeps a Source #
zip :: (Monoid a, Monoid b) => ComponentDeps a -> ComponentDeps b -> ComponentDeps (a, b) Source #
Zip two ComponentDeps
together by Component
, using mempty
as the neutral element when a Component
is present only in one.
filterDeps :: (Component -> a -> Bool) -> ComponentDeps a -> ComponentDeps a Source #
Keep only selected components (and their associated deps info).
mapDeps :: (Component -> a -> b) -> ComponentDeps a -> ComponentDeps b Source #
Keep only selected components (and their associated deps info).
fromLibraryDeps :: a -> ComponentDeps a Source #
ComponentDeps containing library dependencies only
fromSetupDeps :: a -> ComponentDeps a Source #
ComponentDeps containing setup dependencies only.
fromInstalled :: a -> ComponentDeps a Source #
ComponentDeps for installed packages.
We assume that installed packages only record their library dependencies.
Deconstructing ComponentDeps
toList :: ComponentDeps a -> [ComponentDep a] Source #
flatDeps :: Monoid a => ComponentDeps a -> a Source #
All dependencies of a package.
This is just a synonym for fold
, but perhaps a use of flatDeps
is more
obvious than a use of fold
, and moreover this avoids introducing lots of
#ifdef
s for 7.10 just for the use of fold
.
nonSetupDeps :: Monoid a => ComponentDeps a -> a Source #
All dependencies except the setup dependencies.
Prior to the introduction of setup dependencies in version 1.24 this would have been _all_ dependencies.
libraryDeps :: Monoid a => ComponentDeps a -> a Source #
Library dependencies proper only. (Includes dependencies of internal libraries.)
setupDeps :: Monoid a => ComponentDeps a -> a Source #
Setup dependencies.
select :: Monoid a => (Component -> Bool) -> ComponentDeps a -> a Source #
Select dependencies satisfying a given predicate.
components :: ComponentDeps a -> Set Component Source #
List components