Skip to content
Snippets Groups Projects
Commit 520746c6 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add ComponentDeps.filterDeps utility

Required by later nix-local-build branch patches.
parent 5fd4b41f
No related merge requests found
......@@ -21,6 +21,7 @@ module Distribution.Client.ComponentDeps (
, fromList
, singleton
, insert
, filterDeps
, fromLibraryDeps
, fromSetupDeps
, fromInstalled
......@@ -100,6 +101,9 @@ insert comp a = ComponentDeps . Map.alter aux comp . unComponentDeps
aux Nothing = Just a
aux (Just a') = Just $ a `mappend` a'
filterDeps :: (Component -> a -> Bool) -> ComponentDeps a -> ComponentDeps a
filterDeps p = ComponentDeps . Map.filterWithKey p . unComponentDeps
-- | ComponentDeps containing library dependencies only
fromLibraryDeps :: a -> ComponentDeps a
fromLibraryDeps = singleton ComponentLib
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment