GHC-API unloading from external interpreter

Moritz Angermann moritz at
Fri Dec 15 06:04:02 UTC 2017


I believe you are looking for the `Message` GADT in `GHCi.Message`

-- -----------------------------------------------------------------------------
-- The RPC protocol between GHC and the interactive server

-- | A @Message a@ is a message that returns a value of type @a at .
-- These are requests sent from GHC to the server.
data Message a where
maybe specifically the `UnloadObj` message.


> On Dec 15, 2017, at 1:46 PM, Németh Boldizsár <nboldi at> wrote:
> Dear GHC Developers,
> I'm using the GHC API to load Haskell modules and extract their syntax tree. I need to generate code where TH is used (by default I do in-memory linking). I've run into some trouble with external interpreter. When -fexternal-interpreter is NOT set, I use Linker.unload to remove bytecode from the global linker before reloading modules. However it is not applicable when external interpreter is used and I could not find corresponding functionality in the GHCi module (where communication with external interpreter is implemented).
> I've recently created 2 tickets related to this question:,
> Can someone help me with this problem?
> Best Regards,
> Boldizsár Németh
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at

More information about the ghc-devs mailing list