@@ -39,9 +39,6 @@ import Distribution.ModuleName
39
39
import Distribution.Package
40
40
import Distribution.Simple.Utils
41
41
42
- import qualified Control.Applicative as A
43
- import qualified Data.Traversable as T
44
-
45
42
import Control.Monad
46
43
import Text.PrettyPrint
47
44
import qualified Data.Map as Map
@@ -198,14 +195,14 @@ instance Functor InstM where
198
195
fmap f (InstM m) = InstM $ \ s -> let (x, s') = m s
199
196
in (f x, s')
200
197
201
- instance A. Applicative InstM where
198
+ instance Applicative InstM where
202
199
pure a = InstM $ \ s -> (a, s)
203
200
InstM f <*> InstM x = InstM $ \ s -> let (f', s') = f s
204
201
(x', s'') = x s'
205
202
in (f' x', s'')
206
203
207
204
instance Monad InstM where
208
- return = A. pure
205
+ return = pure
209
206
InstM m >>= f = InstM $ \ s -> let (x, s') = m s
210
207
in runInstM (f x) s'
211
208
@@ -259,20 +256,20 @@ toReadyComponents pid_map subst0 comps
259
256
-> InstM (Maybe ReadyComponent )
260
257
instantiateComponent uid cid insts
261
258
| Just lc <- Map. lookup cid cmap = do
262
- provides <- T. mapM (substModule insts) (modShapeProvides (lc_shape lc))
259
+ provides <- traverse (substModule insts) (modShapeProvides (lc_shape lc))
263
260
-- NB: lc_sig_includes is omitted here, because we don't
264
261
-- need them to build
265
262
includes <- forM (lc_includes lc) $ \ ci -> do
266
263
uid' <- substUnitId insts (ci_id ci)
267
264
return ci { ci_ann_id = fmap (const uid') (ci_ann_id ci) }
268
- exe_deps <- mapM (substExeDep insts) (lc_exe_deps lc)
265
+ exe_deps <- traverse (substExeDep insts) (lc_exe_deps lc)
269
266
s <- InstM $ \ s -> (s, s)
270
267
let getDep (Module dep_def_uid _)
271
268
| let dep_uid = unDefUnitId dep_def_uid
272
269
-- Lose DefUnitId invariant for rc_depends
273
270
= [(dep_uid,
274
271
fromMaybe err_pid $
275
- Map. lookup dep_uid pid_map A. <|>
272
+ Map. lookup dep_uid pid_map <|>
276
273
fmap rc_munged_id (join (Map. lookup dep_uid s)))]
277
274
where
278
275
err_pid = MungedPackageId
@@ -313,7 +310,7 @@ toReadyComponents pid_map subst0 comps
313
310
substSubst :: Map ModuleName Module
314
311
-> Map ModuleName OpenModule
315
312
-> InstM (Map ModuleName Module )
316
- substSubst subst insts = T. mapM (substModule subst) insts
313
+ substSubst subst insts = traverse (substModule subst) insts
317
314
318
315
substModule :: Map ModuleName Module -> OpenModule -> InstM Module
319
316
substModule subst (OpenModuleVar mod_name)
@@ -346,7 +343,7 @@ toReadyComponents pid_map subst0 comps
346
343
then do uid' <- substUnitId Map. empty (ci_id ci)
347
344
return $ ci { ci_ann_id = fmap (const (DefiniteUnitId uid')) (ci_ann_id ci) }
348
345
else return ci
349
- exe_deps <- mapM (substExeDep Map. empty) (lc_exe_deps lc)
346
+ exe_deps <- traverse (substExeDep Map. empty) (lc_exe_deps lc)
350
347
let indefc = IndefiniteComponent {
351
348
indefc_requires = map fst (lc_insts lc),
352
349
indefc_provides = modShapeProvides (lc_shape lc),
0 commit comments