External Core in binary format

Neil Mitchell ndmitchell at gmail.com
Mon Jun 18 05:08:04 EDT 2007


Hi

> So presumably you'd be happy if you could do something like this:
>
> import qualified GHC
>
> getYHCCore :: FilePath -> YHC.Core
> getYHCCore file = do
>      s <- GHC.newSession
>      ghc_core <- GHC.compileToCore s "Foo.hs"
>      convertToYHCCore ghc_core
>
> ie. without any on-disk representation at all, just using the GHC API.  We don't
> currently have GHC.compileToCore, but it would be just a matter of doing the
> plumbing.

Yes, that would suit my needs perfectly. The only one niggle might be
that for some applications I'll need to have compiled all the
libraries into Core as well, so the compileToCore function would
require things like "Prelude.hs" to work as well.

Thanks

Neil



More information about the Cvs-ghc mailing list