Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Distribution.Client.CmdRepl
Description
cabal-install CLI command: repl
Synopsis
- replCommand :: CommandUI (NixStyleFlags ReplFlags)
- replAction :: NixStyleFlags ReplFlags -> [String] -> GlobalFlags -> IO ()
- data ReplFlags = ReplFlags {}
- matchesMultipleProblem :: MultiReplDecision -> TargetSelector -> [AvailableTarget ()] -> ReplTargetProblem
- selectPackageTargets :: MultiReplDecision -> TargetSelector -> [AvailableTarget k] -> Either ReplTargetProblem [k]
- selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either ReplTargetProblem k
- data MultiReplDecision = MultiReplDecision {}
The repl
CLI and action
replAction :: NixStyleFlags ReplFlags -> [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 multiple targets are handled
specially 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 :: MultiReplDecision -> TargetSelector -> [AvailableTarget ()] -> ReplTargetProblem Source #
selectPackageTargets :: MultiReplDecision -> 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.
data MultiReplDecision Source #
Constructors
MultiReplDecision | |
Fields |
Instances
Show MultiReplDecision Source # | |
Defined in Distribution.Client.CmdRepl Methods showsPrec :: Int -> MultiReplDecision -> ShowS # show :: MultiReplDecision -> String # showList :: [MultiReplDecision] -> ShowS # | |
Eq MultiReplDecision Source # | |
Defined in Distribution.Client.CmdRepl Methods (==) :: MultiReplDecision -> MultiReplDecision -> Bool # (/=) :: MultiReplDecision -> MultiReplDecision -> Bool # |