Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
ComponentLib | |
ComponentSubLib UnqualComponentName | |
ComponentFLib UnqualComponentName | |
ComponentExe UnqualComponentName | |
ComponentTest UnqualComponentName | |
ComponentBench UnqualComponentName | |
ComponentSetup |
Instances
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 #
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