Skip to content

Commit 0c6f42d

Browse files
committed
Rename tree type
1 parent 37afd3b commit 0c6f42d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Cabal/Distribution/PackageDescription/Configuration.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ instance Monoid d => Mon.Monoid (DepTestRslt d) where
190190
mappend (MissingDeps d) (MissingDeps d') = MissingDeps (d `mappend` d')
191191

192192

193-
data BT a = BT a [BT a] -- very simple binary tree
193+
data Tree a = Tree a [Tree a] -- very simple tree
194194

195195

196196
-- | 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 =
242242
-- solution, @explore@ returns the union of all dependencies that caused
243243
-- it to backtrack. Since the tree is constructed lazily, we avoid some
244244
-- computation overhead in the successful case.
245-
explore :: BT FlagAssignment
245+
explore :: Tree FlagAssignment
246246
-> Either DepMapUnion (TargetSet PDTagged, FlagAssignment)
247-
explore (BT flags ts) =
247+
explore (Tree flags ts) =
248248
let targetSet = TargetSet $ flip map simplifiedTrees $
249249
-- apply additional constraints to all dependencies
250250
first (`constrainBy` extraConstrs) .
@@ -257,10 +257,10 @@ resolveWithFlags dom os arch impl constrs trees checkDeps =
257257

258258
-- Builds a tree of all possible flag assignments. Internal nodes
259259
-- 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 []
262262
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
264264

265265
tryAll :: [Either DepMapUnion a] -> Either DepMapUnion a
266266
tryAll = foldr mp mz
@@ -284,7 +284,6 @@ resolveWithFlags dom os arch impl constrs trees checkDeps =
284284

285285
-- | A map of dependencies that combines version ranges using 'unionVersionRanges'.
286286
newtype DepMapUnion = DepMapUnion { unDepMapUnion :: Map PackageName VersionRange }
287-
deriving (Show, Read)
288287

289288
toDepMapUnion :: [Dependency] -> DepMapUnion
290289
toDepMapUnion ds =

0 commit comments

Comments
 (0)