Package Info

ghc-hackage-db


Access Hackage's package database via Data.Map


Development/Libraries/Haskell

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.


License: BSD-3-Clause
URL: https://hackage.haskell.org/package/hackage-db

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.22-bp150.2.4 info GA Release 2018-08-01 15
  • AArch64
  • ghc-hackage-db
  • ghc-hackage-db-devel
1.22-bp150.2.7 info GA Release 2018-07-30 15
  • ppc64le
  • x86-64
  • ghc-hackage-db
  • ghc-hackage-db-devel