HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleghc-10.0.0.20260917GHC2024

GHC.Runtime.Interpreter

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

  • 5 types
  • 48 values

High-level interface to the interpreter

27 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

loadDLLs loads dynamic libraries using the OS's native linker (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either absolute pathnames to the files, or relative filenames (e.g. "libfoo.so" or "foo.dll"). In the latter case, loadDLLs searches the standard locations for the appropriate libraries.

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
  • Show (Message a)Defined in ghci-10.0.0.20260917 · GHCi.Message