Exposure of synopsis in InstalledPackageInfo
duncan.coutts at googlemail.com
Mon Jan 31 01:42:52 CET 2011
On Tue, 2010-10-19 at 22:08 +0100, Andy Gimblett wrote:
> Hi all,
> Distribution.PackageDescription.PackageDescription contains the
> synopsis field, giving a one-line summary of a package's contents.
> Distribution.InstalledPackageInfo.InstalledPackageInfo, however,
> doesn't contain this field - just the description.
I agree, it would be sensible, symmetric and useful to have the synopsis
in the installed package info too.
> Would it be difficult to expose synopsis in InstalledPackageInfo as
Not very, but it will have to wait for the next major version as all
compilers need to pick up the changes to the InstalledPackageInfo data
> Rationale: I've written a script which queries the package databases
> for all installed packages, and builds an HTML page indexing them by
> package name, with links to local docs (for all versions of the
> package) and hackage; it's a sort of complement to the by-module index
> already produced. I'd like to include the synopsis for each module,
> but pulling it out of the haddock docs (the only solution I can see at
> the moment) feels clumsy given that all the rest of my info is coming
> from the Cabal library.
Right, similarly I bumped into this other day when trying to improve the
output of the cabal info command.
I've pushed a patch to Cabal HEAD. Currently, ghc-pkg will accept and
ignore the synopsis field. When rebuilt against the new Cabal it should
support it. It may require code changes in other compilers, I'm not too
sure. Do not expect for the field to be present until the next major
release of compilers, using the next major release of Cabal.
More information about the cabal-devel