About cabal and compatibility

Simon Marlow simonmar at microsoft.com
Mon Dec 12 08:04:40 EST 2005

On 11 December 2005 01:46, Isaac Jones wrote:

> Robert Dockins <robdockins at fastmail.fm> writes:

>> createVersionModule :: Version -> IO ()
>> createVersionModule version = do
>>   h <- openFile "src/Version.hs" WriteMode
>>   hPutStr h "module Version where\n"
>>   hPutStr h ("version = \""++(showVersion version)++"\"")
>>   hClose h
> That's interesting.  I was recently thinking of generating something
> like CabalInfo.hs which has information like the PackageDescription
> and the LocalBuildInfo.  You would turn on this feature w/ the .cabal
> file.  I'm not sure if any of the information is useful except for the
> version number, though.

This isn't necessary: you can get the version number from Paths_<pkg>
(it's an undocumented feature :-).  See the Cabalised Happy for an
example.  I should probably document it.


More information about the Libraries mailing list