stack-2.15.1: The Haskell Tool Stack
Safe HaskellSafe-Inferred
LanguageGHC2021

Stack.Types.CompCollection

Description

A module providing the type CompCollection and associated helper functions.

The corresponding Cabal approach uses lists. See, for example, the sublibraries, foreignLibs, executables, testSuites, and benchmarks fields.

Cabal removes all the unbuildable components very early (at the cost of slightly worse error messages).

Synopsis

Documentation

data CompCollection component Source #

A type representing collections of components, distinguishing buildable components and non-buildable components.

Instances

Instances details
Foldable CompCollection Source # 
Instance details

Defined in Stack.Types.CompCollection

Methods

fold :: Monoid m => CompCollection m -> m #

foldMap :: Monoid m => (a -> m) -> CompCollection a -> m #

foldMap' :: Monoid m => (a -> m) -> CompCollection a -> m #

foldr :: (a -> b -> b) -> b -> CompCollection a -> b #

foldr' :: (a -> b -> b) -> b -> CompCollection a -> b #

foldl :: (b -> a -> b) -> b -> CompCollection a -> b #

foldl' :: (b -> a -> b) -> b -> CompCollection a -> b #

foldr1 :: (a -> a -> a) -> CompCollection a -> a #

foldl1 :: (a -> a -> a) -> CompCollection a -> a #

toList :: CompCollection a -> [a] #

null :: CompCollection a -> Bool #

length :: CompCollection a -> Int #

elem :: Eq a => a -> CompCollection a -> Bool #

maximum :: Ord a => CompCollection a -> a #

minimum :: Ord a => CompCollection a -> a #

sum :: Num a => CompCollection a -> a #

product :: Num a => CompCollection a -> a #

Monoid (CompCollection component) Source # 
Instance details

Defined in Stack.Types.CompCollection

Methods

mempty :: CompCollection component #

mappend :: CompCollection component -> CompCollection component -> CompCollection component #

mconcat :: [CompCollection component] -> CompCollection component #

Semigroup (CompCollection component) Source # 
Instance details

Defined in Stack.Types.CompCollection

Methods

(<>) :: CompCollection component -> CompCollection component -> CompCollection component #

sconcat :: NonEmpty (CompCollection component) -> CompCollection component #

stimes :: Integral b => b -> CompCollection component -> CompCollection component #

Show component => Show (CompCollection component) Source # 
Instance details

Defined in Stack.Types.CompCollection

Methods

showsPrec :: Int -> CompCollection component -> ShowS #

show :: CompCollection component -> String #

showList :: [CompCollection component] -> ShowS #

getBuildableSet :: CompCollection component -> Set StackUnqualCompName Source #

Get the names of the buildable components in the given collection, as a Set of StackUnqualCompName.

getBuildableSetText :: CompCollection component -> Set Text Source #

Get the names of the buildable components in the given collection, as a Set of Text.

getBuildableListText :: CompCollection component -> [Text] Source #

Get the names of the buildable components in the given collection, as a list of 'Text.

getBuildableListAs Source #

Arguments

:: (StackUnqualCompName -> something)

Function to apply to buildable components.

-> CompCollection component

Collection of components.

-> [something] 

Apply the given function to the names of the buildable components in the given collection, yielding a list.

foldAndMakeCollection Source #

Arguments

:: (HasBuildInfo compB, HasName compB, Foldable sourceCollection) 
=> (compA -> compB)

Function to apply to each element in the data struture.

-> sourceCollection compA

Given foldable data structure of components of type compA.

-> CompCollection compB 

For the given function and foldable data structure of components of type compA, iterates on the elements of that structure and maps each element to a component of type compB while building a CompCollection.

hasBuildableComponent :: CompCollection component -> Bool Source #

Yields True if, and only if, the given collection includes at least one buildable component.

collectionLookup Source #

Arguments

:: Text

Name of the buildable component.

-> CompCollection component

Collection of components.

-> Maybe component 

For the given name of a buildable component and the given collection of components, yields Just component if the collection includes a buildable component of that name, and Nothing otherwise.

collectionKeyValueList :: CompCollection component -> [(Text, component)] Source #

For a given collection of components, yields a list of pairs for buildable components of the name of the component and the component.

collectionMember Source #

Arguments

:: Text

Name of the buildable component.

-> CompCollection component

Collection of components.

-> Bool 

Yields True if, and only if, the given collection of components includes a buildable component with the given name.

foldComponentToAnotherCollection Source #

Arguments

:: Monad m 
=> CompCollection component

Collection of components.

-> (component -> m a -> m a)

Binary operator.

-> m a

Starting value.

-> m a 

Reduce the buildable components of the given collection of components by applying the given binary operator to all buildable components, using the given starting value (typically the right-identity of the operator).