#!/usr/bin/env stack --stack --install-ghc runghc module Version (version) where import System.Environment import System.Exit import System.Process -- | Read current package version -- -- Example: -- -- >>> current_version >>= putStrLn :: IO () -- 0.2.1.8 -- pkg_version :: FilePath -> IO String pkg_version file_name = do contents <- readFile file_name let version_line = lines contents !! 1 let version_word = words version_line !! 1 return version_word version :: String version = "0.2.1.10" main :: IO () main = putStrLn $ version