
On 11 December 2005 01:46, Isaac Jones wrote:
Robert Dockins
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. Cheers, Simon