Exposure of synopsis in InstalledPackageInfo

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. Would it be difficult to expose synopsis in InstalledPackageInfo as well? 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. Thanks, -Andy -- Andy Gimblett http://gimbo.org.uk/

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 well?
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 structure.
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. Duncan
participants (2)
-
Andy Gimblett
-
Duncan Coutts