Ticket #823 (closed enhancement: worksforme)
Accessing the package version from within the package
|Reported by:||basvandijk||Owned by:|
Just like you can access data files from a package, it would be useful to retrieve the current version of your package from within your program.
This is useful when you want to print the current version of your program when the user issues a --version flag for example.
More specifically I would like the following module to be generated automatically:
module Version_pkgname where import Distribution.Version (Version) version :: Version version = <the current package version>
where Version is from the Cabal library.
Having just a String for the version type is also OK and maybe even preferable because otherwise a dependency on the Cabal library is required.