@@ -182,6 +182,7 @@ data GhciPkgDesc = GhciPkgDesc
182182 { package :: ! Package
183183 , cabalFP :: ! (Path Abs File )
184184 , target :: ! Target
185+ -- ^ How the package is intended to be built.
185186 }
186187
187188-- | Type synonym representing maps from a module name to a map with all of the
@@ -292,15 +293,20 @@ ghci opts = do
292293 localTargets
293294 mainFile
294295 pkgs
296+ -- Files targets with unknown GHC options:
295297 (maybe [] snd mfileTargets)
298+ -- The names of packages to be exposed:
296299 (nonLocalTargets ++ addPkgs)
300+ -- A map of package names and sequences of their sublibrary components
301+ -- depended upon (if any):
297302 relevantDependencies
298303
299304preprocessTargets ::
300305 HasEnvConfig env
301306 => BuildOptsCLI
302307 -> SMActual GlobalPackage
303308 -> [Text ]
309+ -- ^ Raw (unprocessed) targets from the command line.
304310 -> RIO env (Either [Path Abs File ] (Map PackageName Target ))
305311preprocessTargets buildOptsCLI sma rawTargets = do
306312 let (fileTargetsRaw, normalTargetsRaw) =
@@ -349,7 +355,12 @@ findFileTargets ::
349355 HasEnvConfig env
350356 => [LocalPackage ]
351357 -> [Path Abs File ]
352- -> RIO env (Map PackageName Target , Map PackageName [Path Abs File ], [Path Abs File ])
358+ -> RIO
359+ env
360+ ( Map PackageName Target
361+ , Map PackageName [Path Abs File ]
362+ , [Path Abs File ]
363+ )
353364findFileTargets locals fileTargets = do
354365 filePackages <- forM locals $ \ lp -> do
355366 PackageComponentFile _ compFiles _ _ <- getPackageFile lp. package lp. cabalFP
@@ -486,10 +497,17 @@ runGhci ::
486497 => GhciOpts
487498 -> [(PackageName , (Path Abs File , Target ))]
488499 -> Maybe (Path Abs File )
500+ -- ^ Path to source file for selected main module. 'Nothing' if no main
501+ -- module is to be loaded and imported.
489502 -> [GhciPkgInfo ]
490503 -> [Path Abs File ]
504+ -- ^ Files targets with unknown GHC options.
491505 -> [PackageName ]
506+ -- ^ The names of packages to be exposed.
492507 -> Map PackageName (Seq NamedComponent )
508+ -- ^ A map of package names and their sublibraries depended on (if
509+ -- any), the package names to be exposed if any sublibraries are
510+ -- depended on.
493511 -> RIO env ()
494512runGhci
495513 ghciOpts
@@ -650,8 +668,12 @@ writeHashedFile outputDirectory relFile contents = do
650668renderScript ::
651669 [GhciPkgInfo ]
652670 -> Maybe (Path Abs File )
671+ -- ^ Path to source file for selected main module. 'Nothing' if no main
672+ -- module is to be loaded and imported.
653673 -> Bool
674+ -- ^ Only load and import the main module?
654675 -> [Path Abs File ]
676+ -- ^ Files targets with unknown GHC options.
655677 -> GhciScript
656678renderScript pkgs mainFile onlyMain extraFiles = do
657679 let addPhase = cmdAdd $ S. fromList (map Left allModules ++ addMain)
0 commit comments