Haddock version during build
Claus Reinke
claus.reinke at talk21.com
Tue Jun 17 12:31:23 EDT 2008
> I wasn't entirely serious when I suggested XML :-)
:-)
You still seem to be using {-# LANGUAGE TongueInCheek #-} here:
> So you're just asking for some way to get the available packages using the
> GHC API? You can do it right now:
>
> Prelude> import Packages
> Prelude Packages> map (showPackageId.package) (UniqFM.eltsUFM (pkgIdMap
> (DynFlags.pkgState dflags)))
You mean if I know which path to put into dflags, I can get it
back out again?-)
I was more hoping for a way to ask GHCi for *its libpath*, so
that I can stuff that into a GHC API session *running in that GHCi*,
and similarly for a GHC-compiled GHC API session.
Not only are those libpaths hard to come by (and having to
hardcode them is a big wart in the GHC API), but if I don't
use the same one that the host GHCi uses, I will get the
wrong package info.
Once I do have the right libpath, your suggestion should work,
but the whole point of not being able to use ':!ghc-pkg list' is
that I don't necessarily know what that path is (to be precise:
I'd like my programs to be able to figure out the right path
for themselves).
Btw, isn't the package processing code shared between
GHC and ghc-pkg? It doesn't look as if the latter is a
GHC API client at all..
Claus
More information about the Cvs-libraries
mailing list