Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
cabal-install CLI command: repl
Synopsis
- replCommand :: CommandUI (NixStyleFlags (ReplOptions, EnvFlags))
- replAction :: NixStyleFlags (ReplOptions, EnvFlags) -> [String] -> GlobalFlags -> IO ()
- matchesMultipleProblem :: TargetSelector -> [AvailableTarget ()] -> ReplTargetProblem
- selectPackageTargets :: TargetSelector -> [AvailableTarget k] -> Either ReplTargetProblem [k]
- selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either ReplTargetProblem k
The repl
CLI and action
replCommand :: CommandUI (NixStyleFlags (ReplOptions, EnvFlags)) Source #
replAction :: NixStyleFlags (ReplOptions, EnvFlags) -> [String] -> GlobalFlags -> IO () Source #
The repl
command is very much like build
. It brings the install plan
up to date, selects that part of the plan needed by the given or implicit
repl target and then executes the plan.
Compared to build
the difference is that only one target is allowed
(given or implicit) and the target type is repl rather than build. The
general plan execution infrastructure handles both build and repl targets.
For more details on how this works, see the module Distribution.Client.ProjectOrchestration
Internals exposed for testing
matchesMultipleProblem :: TargetSelector -> [AvailableTarget ()] -> ReplTargetProblem Source #
selectPackageTargets :: TargetSelector -> [AvailableTarget k] -> Either ReplTargetProblem [k] Source #
This defines what a TargetSelector
means for the repl
command.
It selects the AvailableTarget
s that the TargetSelector
refers to,
or otherwise classifies the problem.
For repl we select:
- the library if there is only one and it's buildable; or
- the exe if there is only one and it's buildable; or
- any other buildable component.
Fail if there are no buildable lib/exe components, or if there are multiple libs or exes.
selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either ReplTargetProblem k Source #
For a TargetComponent
TargetSelector
, check if the component can be
selected.
For the repl
command we just need the basic checks on being buildable etc.