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

Moduleghc-9.10.3GHC2021

GHC.Runtime.Eval

  • 7 types
  • 40 values
  • Packageghc-9.10.3
  • Exports47
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceEval.hs
valuesetContext :: GhcMonad m => [InteractiveImport] -> m ()
#

Set the interactive evaluation context.

(setContext imports) sets the ic_imports field (which in turn determines what is in scope at the prompt) to imports, and updates the icReaderEnv environment to reflect it.

We retain in scope all the things defined at the prompt, and kept in ic_tythings. (Indeed, they shadow stuff from ic_imports.)

valuegetContext :: GhcMonad m => m [InteractiveImport]
#

Get the interactive evaluation context, consisting of a pair of the set of modules from which we take the full top-level scope, and the set of modules from which we take just the exports respectively.

valuegetInfo
  1. :: GhcMonad m
  2. => Bool
  3. -> Name
  4. -> m (Maybe (TyThing, Fixity, [ClsInst], [FamInst], SDoc))
#

Looks up an identifier in the current interactive context (for :info) Filter the instances by the ones whose tycons (or classes resp) are in scope (qualified or otherwise). Otherwise we list a whole lot too many! The exact choice of which ones to show, and which to hide, is a judgement call. (see #1581)