HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleAgda-2.7.0.1Haskell2010

Agda.Interaction.InteractionTop

  • 2 types
  • 43 values
  • PackageAgda-2.7.0.1
  • Exports45
  • LanguageHaskell2010
  • LicenceMIT
  • SourceInteractionTop.hs
valuemaybeAbort :: (IOTCM -> CommandM a) -> CommandM (Command' (Maybe a))
#

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.

valuerevLift
  1. :: MonadState st m
  2. => (forall c. m c -> st -> k (c, st))

    run

  3. -> (forall b. k b -> m b)

    lift

  4. -> (forall x. (m a -> k x) -> k x)
  5. -> m a

    reverse lift in double negative position

#

Build an opposite action to lift for state monads.

valuerevLiftTC
  1. :: MonadTCState m
  2. => (forall c. m c -> TCState -> k (c, TCState))

    run

  3. -> (forall b. k b -> m b)

    lift

  4. -> (forall x. (m a -> k x) -> k x)
  5. -> m a

    reverse lift in double negative position

#
valuerunInteraction :: IOTCM -> CommandM ()
#

Run an IOTCM value, catch the exceptions, emit output

If an error happens the state of CommandM does not change, but stPersistent may change (which contains successfully loaded interfaces for example).

valuecmd_load'
  1. :: FilePath

    File to load into interaction.

  2. -> [String]

    Arguments to Agda for loading this file

  3. -> Bool

    Allow unsolved meta-variables?

  4. -> Mode

    Full type-checking, or only scope-checking?

  5. -> (CheckResult -> CommandM a)

    Continuation after successful loading.

  6. -> 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.

valueparseAndDoAtToplevel
  1. :: (Expr -> TCM a)

    The command to perform.

  2. -> String

    The expression to parse.

  3. -> 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.

valuegive_gen
  1. :: UseForce

    Should safety checks be skipped?

  2. -> InteractionId
  3. -> Range
  4. -> String
  5. -> GiveRefine
  6. -> 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).