Using cabal info
You can use cabal info <packagename> to get package information, including the current version:
$ cabal info QuickCheck
* QuickCheck (library)
Synopsis: Automatic testing of Haskell programs
Versions available: 1.1.0.0, 1.2.0.0, 1.2.0.1, 2.6, 2.7.4, 2.7.5, 2.7.6,
2.8, 2.8.1 (and 24 others)
Versions installed: 2.8.1
Homepage: https://github.com/nick8325/quickcheck
Bug reports: mailto: quickcheck@projects.haskell.org
Description: QuickCheck is a library for random testing of program
properties.
The programmer provides a specification of the program, in
the form of properties which functions should satisfy, and
...
So, all you have to do is grep "Versions installed":
$ cabal info QuickCheck | grep "Versions installed" Versions installed: 2.8.1
On Windows, you can use findstr:
$ cabal info QuickCheck | findstr /C:"Versions installed" Versions installed: 2.8.1
Note. If you do not have <packagename> installed, but want to know some information about this, you may need cabal update .
Using ghc-pkg
If you don't have cabal installed, you can still use the GHC package manager, ghc-pkg :
$ ghc-pkg list QuickCheck C:\Program Files\MinGHC-7.8.4\ghc-7.8.4\lib\package.conf.d: QuickCheck-2.8.1
However, note that ghc-pkg will not recognize bonded sandboxes:
$ cabal sandbox init $ cabal install QuickCheck $ ghc-pkg list QuickCheck C:\Program Files\MinGHC-7.8.4\ghc-7.8.4\lib\package.conf.d: (no packages)
In this case, you need to use ghc-pkg -f .\.cabal-sandbox\<platform>-packages.conf.d or cabal exec :
$ ghc-pkg -f .\.cabal-sandbox\x86_64-windows-ghc-7.8.4-packages.conf.d list QuickCheck .\.cabal-sandbox\x86_64-windows-ghc-7.8.4-packages.conf.d: QuickCheck-2.8.1 $ cabal exec -- ghc-pkg list QuickCheck .\.cabal-sandbox\x86_64-windows-ghc-7.8.4-packages.conf.d: QuickCheck-2.8.1
However, since you are already using cabal , you can simply use cabal info .