Haddock version during build
Simon Marlow
marlowsd at gmail.com
Tue Jun 17 06:08:18 EDT 2008
Claus Reinke wrote:
>>> 1. register other paths that may change with (re-)installation
>>> with ghc-pkg, ..
>> Yes, that could be done. It's a bit yucky though. Maybe we should
>> have an XML configuration file like everybody else.
>
> I'm not a great fan of XML, but no matter the format, the info
> needs to be stored in an accessible way. package.conf seems
> to be the only currently available option.
I wasn't entirely serious when I suggested XML :-)
>> Remember that storing libdir in package.conf is strictly superfluous -
>> you already need to know libdir in order to find package.conf in the
>> first place.
>
> Superfluos in principle, but it would be nice to have all paths
> in a single place for consistency. And then there's practice: in a GHCi
> session, the session itself finds the right package.conf
> (it is just GHC --interactive, after all), but how do I get access to
> that information from the GHCi prompt (I often find myself
> wondering which packages are available for the particular GHCi
> in use, #2345)? In GHC API code, the compiling GHC finds
> package.conf, but how can that information be used in the compiled code
> (see this thread, for instance;-)?
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)))
["X11-1.4.1","rts","base","array-0.1.0.0","packedstring-0.1.0.0","containers-0.1.0.1","bytestring-0.9.0.1","old-locale-1.0.0.0","old-time-1.0.0.0","filepath-1.1.0.0","directory-1.0.0.0","unix-2.3.0.0","process-1.0.0.0","pretty-1.0.0.0","hpc-0.5.0.0","template-haskell","readline-1.0.1.0","Cabal-1.2.3.0","random-1.0.0.0","haskell98","regex-base-0.72.0.1","regex-posix-0.72.0.2","regex-compat-0.71.0.1","parsec-2.1.0.0","haskell-src-1.0.1.1","html-1.0.1.1","network-2.1.0.0","QuickCheck-1.1.0.0","HUnit-1.2.0.0","mtl-1.1.0.0","fgl-5.4.1.1","time-1.1.2.0","OpenGL-2.2.1.1","GLUT-2.1.1.1","OpenAL-1.3.1.1","ALUT-2.1.0.0","stm-2.1.1.0","xhtml-3000.0.2.1","cgi-3001.1.5.1","parallel-1.0.0.0","ghc-6.8.2","hscolour-1.9","zlib-0.4.0.2","Cabal-1.3.3","HTTP-3001.0.4","binary-0.4.1"]
but obviously we've not put any thought into a proper API for this. That's
certainly something that Thomas could do as part of his project.
Cheers,
Simon
More information about the Cvs-libraries
mailing list