Skip to content

Commit 991f5fc

Browse files
committed
Improve library map documentation
1 parent 380fb24 commit 991f5fc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Stack/Build/ConstructPlan.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,11 @@ instance Monoid W where
124124
mempty = memptydefault
125125
mappend = (<>)
126126

127-
type M = RWST -- TODO replace with more efficient WS stack on top of StackT
127+
type M = RWST -- TODO replace with more efficient WS stack on top of (RIO Ctx).
128128
Ctx
129129
W
130130
(Map PackageName (Either ConstructPlanException AddDepRes))
131+
-- ^ Library map
131132
IO
132133

133134
data Ctx = Ctx
@@ -509,7 +510,7 @@ addFinal lp package isAllInOne buildHaddocks = do
509510
tell mempty { wFinals = Map.singleton (packageName package) res }
510511

511512
-- | Given a 'PackageName', adds all of the build tasks to build the package, if
512-
-- needed. First checks if the package name is in the lib map.
513+
-- needed. First checks if the package name is in the library map.
513514
--
514515
-- 'constructPlan' invokes this on all the target packages, setting
515516
-- @treatAsDep'@ to False, because those packages are direct build targets.
@@ -677,7 +678,7 @@ installPackage name ps minstalled = do
677678
Just tb -> do
678679
-- Attempt to find a plan which performs an all-in-one build. Ignore
679680
-- the writer action + reset the state if it fails.
680-
s <- get
681+
libMap <- get
681682
res <- pass $ do
682683
res <- addPackageDeps tb
683684
let writerFunc w = case res of
@@ -711,8 +712,8 @@ installPackage name ps minstalled = do
711712
planDebug $
712713
"installPackage: Before trying cyclic plan, resetting lib \
713714
\result map to "
714-
<> show s
715-
put s
715+
<> show libMap
716+
put libMap
716717
-- Otherwise, fall back on building the tests / benchmarks in a
717718
-- separate step.
718719
res' <- resolveDepsAndInstall
@@ -808,7 +809,7 @@ installPackageGivenDeps isAllInOne buildHaddocks ps package minstalled
808809
packageBuildTypeConfig :: Package -> Bool
809810
packageBuildTypeConfig pkg = packageBuildType pkg == Configure
810811

811-
-- Update response in the lib map. If it is an error, and there's already an
812+
-- Update response in the library map. If it is an error, and there's already an
812813
-- error about cyclic dependencies, prefer the cyclic error.
813814
updateLibMap :: PackageName -> Either ConstructPlanException AddDepRes -> M ()
814815
updateLibMap name val = modify $ \mp ->

0 commit comments

Comments
 (0)