hackage-db-1.7: provide access to the Hackage database via Data.Map

Portabilityportable
Stabilityprovisional
Maintainersimons@cryp.to
Safe HaskellNone

Distribution.Hackage.DB

Description

This module provides simple access to the Hackage database by means of Map. Note that once the database has been parsed, it can be accessed quickly, but the inital cost of reading 00-index.tar is fairly high.

Synopsis

Documentation

type Hackage = Map String (Map Version GenericPackageDescription)Source

A Map representation of the Hackage database. For sake of simplicity, we use String rather than PackageName to represent the name of a package.

readHackage :: IO HackageSource

Read the Hackage database from $HOME/<package database path>/hackage.haskell.org/00-index.tar and return a Map that provides fast access to its contents. That tar file is typically created by running the command "cabal update".

readHackage' :: FilePath -> IO HackageSource

Read the Hackage database from the given FilePath and return a Hackage map that provides fast access to its contents.

parseHackage :: ByteString -> HackageSource

Parse the contents of Hackage's 00-index.tar into a Hackage map.

module Data.Map