What version is the package X in stackage lts-Y.ZZ?

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed and maintained by Toshio Ito


travis status

staversion is a command-line tool to look for version numbers of Haskell packages.

See --help message for detailed usage.

Package version in Stackage

staversion mainly focuses on package versions in stackage, i.e. it answers to questions like "What version is the package X in stackage lts-Y.ZZ?" It aims to make it easier to write build-depends section in YOUR_PACKAGE.cabal.

$ staversion --resolver lts-4.2 conduit
------ lts-4.2
conduit ==

$ staversion --resolver lts-4.2 --resolver lts-7.0 conduit
------ lts-4.2
conduit ==

------ lts-7.0
conduit ==1.2.7

$ staversion --resolver lts-4.2 --resolver lts-6 conduit base
------ lts-4.2
conduit ==,
base ==

------ lts-6
conduit ==1.2.8,
base ==

staversion first reads build plan YAML files that are stored locally in your computer, then it tries to fetch them over network.

Package version in Hackage

You can also look up the latest version numbers hosted on hackage.

$ staversion --hackage conduit base
------ latest in hackage
conduit ==1.2.8,
base ==

Package version for build-depends

You can also specify .cabal files in the query. In that case, staversion reads build-depends fields in all sections of those .cabal files, and shows versions of the dependency packages.

$ staversion --hackage staversion.cabal 
------ latest in hackage
-- staversion.cabal - library
base ==,
unordered-containers ==,
aeson ==,
text ==,
bytestring ==,
yaml ==,
filepath ==,
directory ==,
optparse-applicative ==,
containers ==,
http-client ==0.5.5,
http-client-tls ==0.3.3,
http-types ==0.9.1,
transformers ==,
transformers-compat ==,
megaparsec ==5.1.2



  • Show version number ranges supported by the given resolvers.
  • Cache build plans in some local storage (SQLite?)


Toshio Ito


Revision history for staversion -- 2017-01-05

  • Fix dependency lower bound for base. It was >=4.6, but now it's >=4.8 due to dependency on megaparsec. -- 2017-01-03

  • Now staversion can parse the "curly brace" format of .cabal files (to some extent.)
  • Confirmed test with aeson- -- 2016-12-29

  • Now staversion shows the exact resolver for a partial resolver (e.g. "lts-4" -> "lts-4.2")
  • Now staversion reads .cabal files, and uses their build-depends fields as query.
  • Fix minor error in ordering the result. -- 2016-11-10

  • New option --hackage, which searches hackage for the latest version number. -- 2016-11-03

  • Now staversion fetches build plan YAML files over network, if necessary.
  • Now staversion disambiguates partial resolvers (e.g. "lts-2") into exact resolvers (e.g. "lts-2.22").
  • New option --no-network, which forbids staversion to access network. -- 2016-10-16

  • First version. Released on an unsuspecting world.
comments powered byDisqus