The hackage-db package

[Tags: bsd3, library]

This module provides simple access to the Hackage database by means of Data.Map. Suppose you wanted to implement a utility that queries the set of available versions for a given package, the following program would do the trick:

 import qualified Distribution.Hackage.DB as DB
 import Distribution.Text ( display )
 import System.Environment ( getArgs )

 main :: IO ()
 main = do
   pkgs <- getArgs
   db <- DB.readHackage
   let getVersions name = maybe [] DB.keys (DB.lookup name db)
   mapM_ (putStrLn . unwords . map display . getVersions) pkgs

When run, it would produce the following output:

 ./a.out containers deepseq cabal-install
 0.1.0.0 0.1.0.1 0.2.0.0 0.2.0.1 0.3.0.0 0.4.0.0
 1.0.0.0 1.1.0.0 1.1.0.1 1.1.0.2
 0.4.0 0.5.0 0.5.1 0.5.2 0.6.0 0.6.2 0.6.4 0.8.0 0.8.2 0.10.0 0.10.2

Properties

Versions1.0, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.9.1, 1.10, 1.11, 1.22
Change logNone available
Dependenciesbase (>=3 && <5), bytestring, Cabal, containers, directory, filepath, tar (>=0.4), utf8-string [details]
LicenseBSD3
CopyrightPeter Simons
AuthorPeter Simons <simons@cryp.to>
MaintainerPeter Simons <simons@cryp.to>
CategoryDistribution
Home pagehttp://github.com/peti/hackage-db
Source repositoryhead: git clone git://github.com/peti/hackage-db.git
UploadedThu Jan 15 20:31:34 UTC 2015 by PeterSimons
UpdatedFri Jan 16 20:50:27 UTC 2015 by PeterSimons to revision 1
DistributionsLTSHaskell:1.22, Stackage:1.22
Downloads5519 total (337 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Last success reported on 2015-01-15 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees