RE: Collecting all external names in a module

2010-09-17 Thread Simon Peyton-Jones
Johan GHC already collects all RdrNames for imported things, for use when reporting unused imports. But it doesn't collect the SrcSpan of the occurrences, nor does it collect occurrences of locally-bound things. I suggest you write a general traversal looking like data Gather var res = Gat

Template Haskell and linking

2010-09-17 Thread Jonas Almström Duregård
Hi GHC users! Does anyone know if an import that is only used by Template Haskell (i.e. not in "actual" code) is reflected in the produced executable? Example: import LargeModule(thFunction) $thfunction ... Is LargeModule linked in the executable file? (Assume thFunction is not referenced by

clearing GHCi (and, by extension, hint) loaded module dependencies

2010-09-17 Thread Alex Suraci
Context: My language uses hint to interpret Haskell code at runtime, via `load: "path/to/file.hs"`. Hint works similar to ":load foo.hs" in GHCi (it uses the GHC API). After the source is interpreted the module's `load` function is executed in the language's VM. There is no valuable result; it i

Re: Interruptible GHC

2010-09-17 Thread Edward Z. Yang
Here's what the Windows version would look like (if I could get HEAD to build, that is :-) void interruptOSThread (OSThreadId id) { HANDLE hdl; PCSIO pCSIO; if (!(hdl = OpenThread(THREAD_TERMINATE,FALSE,id))) { sysErrorBelch("interruptOSThread: OpenThread"); stg_exit(EX