Using GHC-as-a-library

Martin Grabmueller magr at
Fri Oct 6 05:20:54 EDT 2006

Following up to myself:

Martin Grabmueller wrote:
> Hello all,
> I've been playing around with GHC-as-a-library a bit now, and using
> yesterday's snapshot of GHC (ghc-6.5.20061004, compiled from source),
> I ran into the following problem:

In following a suggestion by Mathew Mills, I tried to find out whether
there was a problem with GHC finding my package.conf file (since I had
previously a problem with ghc-pkg to set permissions wrong on that file,
I thought GHC was possibly unable to read it).

When trying it again with a GHC fresh from darcs HEAD, I get a different
error message.  The loading via GHC.load works find, but when calling
GHC.checkModule, the following error message is displayed, and no
renamed or typechecked program is returned by GHC.checkModule, only the
parsed one:

    Bad interface file: /usr/local/ghc/lib/ghc-6.5/imports/Prelude.hi
        Prelude.Enum.Bool.toEnum: bad argument

Has anyone else encountered this problem?  Are others out there
successfully using GHC as a library?

Thanks again,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url :

More information about the Glasgow-haskell-users mailing list