The wisp's world: the modules in interpreter scope.
Constructors
ScopescopeModules :: [(String, Maybe String)]
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11
Modulevortex-elab-0.2.2GHC2024
Two flavours: elabAs/elabShow boot a fresh GHC session per call
(simple, ~seconds each); newWarmSession keeps one session alive and
serves calls over a channel (~milliseconds each after the first). Both
enter the wisp's world through enterScope, so a block means the same
in either.
The wisp's world: the modules in interpreter scope.
ScopescopeModules :: [(String, Maybe String)]Elaborate source as a term of the named type. The caller chooses
a; soundness of the coercion is the caller's obligation to pair
the type name with the type it actually runs. The kernel is the
only intended caller. Every error names the line and column it has
in the source, as <hint>:LINE:COL: error: ....
Elaborate and show a pure expression: the empty theory, where evaluation is just forcing. Bounded here because forcing happens inside the interpreter session.
The type of an expression, without running it — :type. Cheaper
and safer than evaluation: it typechecks only.
The DSL's callable surface: for each function exported by a scope
module imported unaliased, other than Prelude, its name paired with
its raw type. This is the capability discovery primitive — reflected
from the export list, so it is exactly what a wisp may name bare. A
module under an alias (Data.List as List) is a library named
through it, not part of the verb table, so it is not listed. The
caller normalises the type and attaches docs.
A live GHC session that serves elaboration requests without re-booting. Both fields serialise onto the one session thread, so concurrent callers queue rather than clash (GHC's session state is process-global and single-threaded — hence one session, not many).
WarmHandlewarmInterpret :: forall a. String -> String -> IO (Either ElabErr a)warmInterpret typeName source: elaborate source at the
named type, returning the (unsafely coerced) term. Same contract
and caller obligation as elabAs.
warmEval :: String -> IO (Either ElabErr String)Elaborate and show a pure expression, like elabShow.
warmType :: String -> IO (Either ElabErr String)The type of an expression, like typeOfExpr.
warmDescribe :: IO (Either ElabErr [(String, String)])The scope's callable surface, like describeScope.
Boot one persistent GHC session and return handles onto it. The session thread lives for the process; its DynFlags, package db, and imports are paid once, so each subsequent request is just compile-the-expression.