Using "GHC as a library" with own functions makes runStmt return RunBreak

Mads Lindstrøm mads_lindstroem at
Wed Jan 30 12:00:16 EST 2008


I am trying to use "GHC as a library". From runStmt, I want to load and run
functions from a home-grown module. Lets call my home-grown module HomeGrown.hs.

I have tried to model my application after / from . This library loads
MyPrelude.hs and runs myPutStrLn & myGetLine + more.

However, when I try to run code from HomeGrown.hs like:

  runStmt session "" GHC.SingleStep

runStmt keeps returning RunBreak (of type RunResult). From what I can read of
the WWW, RunBreak is related to some debugger and indicate that GHC encountered
some breakpoint. However, I did not set any break points.

Comparing Interactive-6.8 and MyPrelude.hs to my own code, the largest
difference seemed to be that Interactive-6.8 do not only use MyPrelude.hs by
calling `addTarget` and `setContext`, it also imports MyPrelude.hs as a regular
Haskell import (import MyPrelude). Thus I tried to remove this import to see
what would happen. Interactive-6.8 compiled and started just fine. However,
whenever it needed to use any functions in MyPrelude, runStmt also returned

So is it only possible to load home-grown/non-standard modules when also doing a
regular import?


Mads Lindstrøm

More information about the Glasgow-haskell-users mailing list