Created
December 6, 2015 11:17
-
-
Save blippy/ef8b81e9e0bbff4018df to your computer and use it in GitHub Desktop.
Embed cabal package version in Haskell code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ExampleVersion where | |
{- | |
links: | |
http://stackoverflow.com/questions/9857710/haskell-correct-practice-to-specify-%5Cversion-in-source | |
Be sure to put Paths_packagename in your Other-Modules section of the cabal file. | |
-} | |
import Paths_mypackage (version) -- replace 'mypackage' with you nnn.cabal 'name' tag | |
import Data.Version (showVersion) | |
printVersion :: IO () | |
printVersion = putStrLn (showVersion version) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment