Skip to content

Commit 20aa401

Browse files
committed
feat(cabal-install-solver): add null to ComponentDeps
1 parent d6f9a12 commit 20aa401

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cabal-install-solver/src/Distribution/Solver/Types/ComponentDeps.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ module Distribution.Solver.Types.ComponentDeps (
3636
, setupDeps
3737
, select
3838
, components
39+
, null
3940
) where
4041

4142
import Prelude ()
4243
import Distribution.Types.UnqualComponentName
43-
import Distribution.Solver.Compat.Prelude hiding (empty,toList,zip)
44+
import Distribution.Solver.Compat.Prelude hiding (null, empty, toList, zip)
4445

4546
import qualified Data.Map as Map
4647
import Data.Foldable (fold)
@@ -133,6 +134,9 @@ insert comp a = ComponentDeps . Map.alter aux comp . unComponentDeps
133134
aux Nothing = Just a
134135
aux (Just a') = Just $ a `mappend` a'
135136

137+
null :: ComponentDeps a -> Bool
138+
null = Map.null . unComponentDeps
139+
136140
-- | Zip two 'ComponentDeps' together by 'Component', using 'mempty'
137141
-- as the neutral element when a 'Component' is present only in one.
138142
zip

0 commit comments

Comments
 (0)