File: get_version.hs

package info (click to toggle)
happy 2.1.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 656 kB
  • sloc: yacc: 2,501; haskell: 1,329; makefile: 273
file content (13 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Main (main) where

import Distribution.Package
import Distribution.PackageDescription
import Distribution.Simple.PackageDescription (readGenericPackageDescription)
import Distribution.Pretty                    ( prettyShow )
import Distribution.Simple.Utils
import Distribution.Verbosity

main :: IO ()
main = do Right fp <- findPackageDesc "."
          pd <- readGenericPackageDescription normal fp
          putStr $ prettyShow $ pkgVersion $ package $ packageDescription pd