HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Runtime.Interpreter

Interacting with the iserv interpreter, whether it is running on an external process or in the current process.

  • 5 types
  • 47 values
  • Packageghc-9.10.3
  • Exports52
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceInterpreter.hs

High-level interface to the interpreter

26 declarations
datadata EvalStatus_ a b
#
Instances4Show, Generic, Binary, Rep
datadata EvalResult a
#
Instances4Show, Generic, Binary, Rep
datadata EvalExpr a
#

We can pass simple expressions to EvalStmt, consisting of values and application. This allows us to wrap the statement to be executed in another function, which is used by GHCi to implement :set args and :set prog. It might be worthwhile to extend this little language in the future.

Constructors

Instances4Show, Generic, Binary, Rep

The object-code linker

25 declarations

loadDLL loads a dynamic library using the OS's native linker (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either an absolute pathname to the file, or a relative filename (e.g. "libfoo.so" or "foo.dll"). In the latter case, loadDLL searches the standard locations for the appropriate library.

valueinterpCmd :: Binary a => Interp -> Message a -> IO a
#

Run a command in the interpreter's context. With -fexternal-interpreter, the command is serialized and sent to an external iserv process, and the response is deserialized (hence the Binary constraint). With -fno-external-interpreter we execute the command directly here.

valuewormhole :: Interp -> ForeignRef a -> IO a
#

Convert a ForeignRef to the value it references directly. This only works when the interpreter is running in the same process as the compiler, so it fails when -fexternal-interpreter is on.

valuewormholeRef :: Interp -> RemoteRef a -> IO a
#

Convert an RemoteRef to the value it references directly. This only works when the interpreter is running in the same process as the compiler, so it fails when -fexternal-interpreter is on.

Reexport for convenience

1 declaration
datadata Message a where
#

A Message a is a message that returns a value of type a. These are requests sent from GHC to the server.

Constructors

Instances1Show