@@ -190,7 +190,7 @@ instance Monoid d => Mon.Monoid (DepTestRslt d) where
190
190
mappend (MissingDeps d) (MissingDeps d') = MissingDeps (d `mappend` d')
191
191
192
192
193
- data BT a = BT a [BT a ] -- very simple binary tree
193
+ data Tree a = Tree a [Tree a ] -- very simple tree
194
194
195
195
196
196
-- | Try to find a flag assignment that satisfies the constraints of all trees.
@@ -242,9 +242,9 @@ resolveWithFlags dom os arch impl constrs trees checkDeps =
242
242
-- solution, @explore@ returns the union of all dependencies that caused
243
243
-- it to backtrack. Since the tree is constructed lazily, we avoid some
244
244
-- computation overhead in the successful case.
245
- explore :: BT FlagAssignment
245
+ explore :: Tree FlagAssignment
246
246
-> Either DepMapUnion (TargetSet PDTagged , FlagAssignment )
247
- explore (BT flags ts) =
247
+ explore (Tree flags ts) =
248
248
let targetSet = TargetSet $ flip map simplifiedTrees $
249
249
-- apply additional constraints to all dependencies
250
250
first (`constrainBy` extraConstrs) .
@@ -257,10 +257,10 @@ resolveWithFlags dom os arch impl constrs trees checkDeps =
257
257
258
258
-- Builds a tree of all possible flag assignments. Internal nodes
259
259
-- have only partial assignments.
260
- build :: [(FlagName , [Bool ])] -> FlagAssignment -> BT FlagAssignment
261
- build [] flags = BT flags []
260
+ build :: [(FlagName , [Bool ])] -> FlagAssignment -> Tree FlagAssignment
261
+ build [] flags = Tree flags []
262
262
build ((n, vals): rest) flags =
263
- BT flags $ map (\ v -> build rest ((n, v): flags)) vals
263
+ Tree flags $ map (\ v -> build rest ((n, v): flags)) vals
264
264
265
265
tryAll :: [Either DepMapUnion a ] -> Either DepMapUnion a
266
266
tryAll = foldr mp mz
@@ -284,7 +284,6 @@ resolveWithFlags dom os arch impl constrs trees checkDeps =
284
284
285
285
-- | A map of dependencies that combines version ranges using 'unionVersionRanges'.
286
286
newtype DepMapUnion = DepMapUnion { unDepMapUnion :: Map PackageName VersionRange }
287
- deriving (Show , Read )
288
287
289
288
toDepMapUnion :: [Dependency ] -> DepMapUnion
290
289
toDepMapUnion ds =
0 commit comments