[Haskell-cafe] GHC API: runStmt not taking into account reloaded module

JP Moresmau jpmoresmau at gmail.com
Tue Jan 14 20:13:40 UTC 2014

It's late here and I'm probably overlooking something stupid, so I'd like
if somebody could put my nose on it... I'm using the GHC API to evaluate
statements. I use runStmt to get a RunResult, lookupName to get the ID for
the bound names, obtainTermFromId to get the term and showTerm to display
it. So I can call a function from the loaded module with some parameters
and get the result. Good!
However, if I reload a module and I change the implementation of the
function, runStmt still returns the old value! I know the reload worked
because if I added new names, getNamesInScope returns the new names. What
do I need to do to make sure the new function definitions are used? I've
perused the source code of InteractiveEval and ghci but nothing stood out.
I am calling setContext after load.

Thanks a million!

JP Moresmau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140114/d208339d/attachment.html>

More information about the Haskell-Cafe mailing list