| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Agda.Interaction.InteractionTop
Synopsis
- atTopLevel :: CommandM a -> CommandM a
- cmd_goal_type_context_and :: GoalTypeAux -> Rewrite -> InteractionId -> Range -> String -> CommandM ()
- cmd_load' :: FilePath -> [String] -> Bool -> Mode -> (CheckResult -> CommandM a) -> CommandM a
- commandMToIO :: (forall x. (CommandM a -> IO x) -> IO x) -> CommandM a
- decorate :: Doc -> String
- displayStatus :: CommandM ()
- display_info :: DisplayInfo -> CommandM ()
- extlam_dropName :: UnicodeOrAscii -> CaseContext -> String -> String
- getBackendName :: CompilerBackend -> BackendName
- getOldInteractionScope :: InteractionId -> CommandM ScopeInfo
- give_gen :: UseForce -> InteractionId -> Range -> String -> GiveRefine -> CommandM ()
- handleCommand :: (forall a. CommandM a -> CommandM a) -> CommandM () -> CommandM () -> CommandM ()
- handleCommand_ :: CommandM () -> CommandM ()
- highlightExpr :: Expr -> TCM ()
- independent :: Interaction -> Bool
- initialiseCommandQueue :: IO Command -> IO CommandQueue
- insertOldInteractionScope :: InteractionId -> ScopeInfo -> CommandM ()
- interpret :: Interaction -> CommandM ()
- liftCommandMT :: (forall x. TCM x -> TCM x) -> CommandM a -> CommandM a
- liftCommandMTLocalState :: (forall x. TCM x -> TCM x) -> CommandM a -> CommandM a
- makeCaseVariant :: CaseContext -> MakeCaseVariant
- maybeAbort :: (IOTCM -> CommandM a) -> CommandM (Command' (Maybe a))
- maybeTimed :: CommandM a -> CommandM (Maybe CPUTime, a)
- modifyOldInteractionScopes :: (OldInteractionScopes -> OldInteractionScopes) -> CommandM ()
- modifyTheInteractionPoints :: ([InteractionId] -> [InteractionId]) -> CommandM ()
- parseAndDoAtToplevel :: (Expr -> TCM a) -> String -> CommandM (Maybe CPUTime, a)
- parseExprFromAuto :: InteractionId -> Range -> String -> (Expr -> CommandM a) -> CommandM (Either String a)
- putResponse :: Response -> CommandM ()
- removeOldInteractionScope :: InteractionId -> CommandM ()
- runInteraction :: IOTCM -> CommandM ()
- searchAbout :: Rewrite -> Range -> String -> CommandM ()
- setCommandLineOpts :: CommandLineOptions -> CommandM ()
- showModuleContents :: Rewrite -> Range -> String -> CommandM ()
- solveInstantiatedGoals :: Rewrite -> Maybe InteractionId -> CommandM ()
- sortInteractionPoints :: (MonadInteractionPoints m, MonadError TCErr m, MonadDebug m) => [InteractionId] -> m [InteractionId]
- status :: CommandM Status
- syncInteractionRange :: (MonadInteractionPoints m, MonadDebug m, MonadError TCErr m) => InteractionId -> Range -> m Range
- tellEmacsToJumpToError :: Range -> [Response]
- tellToUpdateHighlighting :: Maybe (HighlightingInfo, HighlightingMethod, ModuleToSource) -> IO [Response]
- updateInteractionPointsAfter :: Interaction -> Bool
- whyInScope :: String -> CommandM ()
- withCurrentFile :: CommandM a -> CommandM a
- data GiveRefine
- = Give
- | Refine
- | Intro
- | ElaborateGive Rewrite
Documentation
atTopLevel :: CommandM a -> CommandM a Source #
cmd_goal_type_context_and :: GoalTypeAux -> Rewrite -> InteractionId -> Range -> String -> CommandM () Source #
Displays the current goal, the given document, and the current context.
Should not modify the state.
Arguments
| :: FilePath | File to load into interaction. |
| -> [String] | Arguments to Agda for loading this file |
| -> Bool | Allow unsolved meta-variables? |
| -> Mode | Full type-checking, or only scope-checking? |
| -> (CheckResult -> CommandM a) | Continuation after successful loading. |
| -> CommandM a |
cmd_load' file argv unsolvedOk cmd
loads the module in file file,
using argv as the command-line options.
If type checking completes without any exceptions having been
encountered then the command cmd r is executed, where r is the
result of typeCheckMain.
commandMToIO :: (forall x. (CommandM a -> IO x) -> IO x) -> CommandM a Source #
Opposite of liftIO for CommandM.
This function should only be applied to computations that are
guaranteed not to raise any errors (except for IOExceptions).
displayStatus :: CommandM () Source #
Displays or updates status information.
Does not change the state.
display_info :: DisplayInfo -> CommandM () Source #
display_info does what does, but
additionally displays some status information (see displayInfo Falsestatus and
displayStatus).
extlam_dropName :: UnicodeOrAscii -> CaseContext -> String -> String Source #
Arguments
| :: UseForce | Should safety checks be skipped? |
| -> InteractionId | |
| -> Range | |
| -> String | |
| -> GiveRefine | |
| -> CommandM () |
A "give"-like action (give, refine, etc).
give_gen force ii rng s give_ref mk_newtxt
acts on interaction point ii
occupying range rng,
placing the new content given by string s,
and replacing ii by the newly created interaction points
in the state if safety checks pass (unless force is applied).
handleCommand :: (forall a. CommandM a -> CommandM a) -> CommandM () -> CommandM () -> CommandM () Source #
handleCommand_ :: CommandM () -> CommandM () Source #
Do setup and error handling for a command.
highlightExpr :: Expr -> TCM () Source #
independent :: Interaction -> Bool Source #
Can the command run even if the relevant file has not been loaded into the state?
initialiseCommandQueue Source #
Arguments
| :: IO Command | Returns the next command. |
| -> IO CommandQueue |
Creates a command queue, and forks a thread that writes commands to the queue. The queue is returned.
insertOldInteractionScope :: InteractionId -> ScopeInfo -> CommandM () Source #
interpret :: Interaction -> CommandM () Source #
Interpret an interaction.
For each goal command specific to an InteractionPoint
that comes with a Range for this interaction point
we first synchronize this Range with the Range
Agda has stored for the interaction meta.
In general, we consider the Range sent with the command
as more up-to-date than the the Range Agda has stored.
This is because the editor keeps track of changes
(that usually modify the position of interaction points),
but Agda does not.
Some goal commands carry a Range for reasons of uniformity but do not use it.
For those, we do not synchronize the range.
liftCommandMT :: (forall x. TCM x -> TCM x) -> CommandM a -> CommandM a Source #
Lift a TCM action transformer to a CommandM action transformer.
liftCommandMTLocalState :: (forall x. TCM x -> TCM x) -> CommandM a -> CommandM a Source #
Ditto, but restore state.
maybeAbort :: (IOTCM -> CommandM a) -> CommandM (Command' (Maybe a)) Source #
If the next command from the command queue is anything but an actual command, then the command is returned.
If the command is an IOTCM command, then the following happens:
The given computation is applied to the command and executed. If an
abort command is encountered (and acted upon), then the computation
is interrupted, the persistent state and all options are restored,
and some commands are sent to the frontend. If the computation was
not interrupted, then its result is returned.
modifyOldInteractionScopes :: (OldInteractionScopes -> OldInteractionScopes) -> CommandM () Source #
A Lens for oldInteractionScopes.
modifyTheInteractionPoints :: ([InteractionId] -> [InteractionId]) -> CommandM () Source #
A Lens for theInteractionPoints.
Arguments
| :: (Expr -> TCM a) | The command to perform. |
| -> String | The expression to parse. |
| -> CommandM (Maybe CPUTime, a) |
Parses and scope checks an expression (using the "inside scope" as the scope), performs the given command with the expression as input, and returns the result and the time it takes.
parseExprFromAuto :: InteractionId -> Range -> String -> (Expr -> CommandM a) -> CommandM (Either String a) Source #
Try to parse an expression generated by Auto and feed it to the continuation if successful.
If unsuccessful, just report the solution via Info_Auto.
putResponse :: Response -> CommandM () Source #
Put a response by the callback function given by stInteractionOutputCallback.
runInteraction :: IOTCM -> CommandM () Source #
searchAbout :: Rewrite -> Range -> String -> CommandM () Source #
Shows all the top-level names in scope which mention all the given identifiers in their type.
setCommandLineOpts :: CommandLineOptions -> CommandM () Source #
Sets the command line options and updates the status information.
showModuleContents :: Rewrite -> Range -> String -> CommandM () Source #
Shows all the top-level names in the given module, along with their types.
solveInstantiatedGoals :: Rewrite -> Maybe InteractionId -> CommandM () Source #
Solved goals already instantiated internally The second argument potentially limits it to one specific goal.
sortInteractionPoints :: (MonadInteractionPoints m, MonadError TCErr m, MonadDebug m) => [InteractionId] -> m [InteractionId] Source #
Sorts interaction points based on their ranges.
syncInteractionRange :: (MonadInteractionPoints m, MonadDebug m, MonadError TCErr m) => InteractionId -> Range -> m Range Source #
If given range is empty, get the range of the interaction point. Otherwise, set the range of the interaction point to the given range.
The idea is that the interaction frontend may have a more recent range for an interaction point (for example, if the user has edited the file since the last command was sent).
There may be frontends that do not send ranges (like the interaction test suite), so in that case get the range from the interaction point.
tellEmacsToJumpToError :: Range -> [Response] Source #
Tells the Emacs mode to go to the first error position (if any).
tellToUpdateHighlighting :: Maybe (HighlightingInfo, HighlightingMethod, ModuleToSource) -> IO [Response] Source #
Tell to highlight the code using the given highlighting
info (unless it is Nothing).
updateInteractionPointsAfter :: Interaction -> Bool Source #
Should Resp_InteractionPoints be issued after the command has
run?
whyInScope :: String -> CommandM () Source #
Explain why something is in scope.
withCurrentFile :: CommandM a -> CommandM a Source #
Set envCurrentPath to theCurrentFile, if any.
data GiveRefine Source #
Constructors
| Give | |
| Refine | |
| Intro | |
| ElaborateGive Rewrite |
Instances
| Show GiveRefine Source # | |
Defined in Agda.Interaction.InteractionTop Methods showsPrec :: Int -> GiveRefine -> ShowS # show :: GiveRefine -> String # showList :: [GiveRefine] -> ShowS # | |
| Eq GiveRefine Source # | |
Defined in Agda.Interaction.InteractionTop | |