Cabal hooks

Krasimir Angelov kr.angelov at
Tue Jan 11 07:33:52 EST 2005

Hello, Guys

I am trying to cabalize HSQL. There is a simple ./configure script
which performs some simple checks. Now I would like to perform these
checks from Setup.lhs using Cabal hooks. The hooks API looks a little
bit strange for me. The preConf hooks returns (Maybe
PackageDescription) which after that is merged with the basic
description. The Setup.buildinfo file contains only the hooked
description instead of merged one. The parser requires to have package
name and version, in order to properly parse the description. I need
to return the right name and version from preConf hook to satisfy this
restriction. I can't do this without re-reading the original
description from Setup.description. Isn't it simpler to change the
hooks type to something like:

PackageDescription -> IO PackageDescription

where the argument is the original description and the result is the
possible updated one? This avoids the need of merging and simplifies
the library code.


More information about the Libraries mailing list