cabal-file-0.1.0: Cabal file access

Safe HaskellNone
LanguageHaskell2010

Hackage.Index

Contents

Synopsis

Documentation

getCabal :: PackageIdentifier -> IO ByteString Source #

Get the contents of the .cabal file for package version

getCabals :: PackageIdentifier -> PackageIdentifier -> IO (ByteString, ByteString) Source #

Get two .cabal files at once!

withCabalFile :: PackageIdentifier -> (FilePath -> IO a) -> IO a Source #

Pass a temporary copy of .cabal file to some action

listPackages :: IO [String] Source #

List all packages in the index (unsorted for performance)

packageVersions :: PackageName -> IO [Version] Source #

Get all versions of a package in the index

latestVersion :: PackageName -> IO (Maybe Version) Source #

Get the latest version of package from the index

Note: does not take preferred-versions into account

preferredVersions :: PackageName -> IO (Maybe ByteString) Source #

Get the preferred-versions metadata for package

getTimestamp :: PackageIdentifier -> IO (Maybe UTCTime) Source #

Get the index timestamp for (the latest revision of) pkgid

indexFiles :: IO [String] Source #

List all files in the Hackage index (.cabal files, metadata .json files, preferred-versions files)

getPackageDescription :: PackageIdentifier -> IO (Maybe PackageDescription) Source #

Get and try to parse the PackageDescription of a package version

getPackageDescription' :: PackageIdentifier -> IO PackageDescription Source #

Get and parse PackageDescription of package version

Raises an error on failure.

packageIdOrLatest :: PackageIdentifier -> IO PackageIdentifier Source #

Convert a PackageID if unversioned to latest package version

getFileInfo :: PackageIdentifier -> IO FileInfo Source #

Get FileInfo metadata for package version source

Re-exports from hackage-security

data FileInfo #

Constructors

FileInfo 

Fields

Instances
Show FileInfo 
Instance details

Defined in Hackage.Security.TUF.FileInfo

Methods

showsPrec :: Int -> FileInfo -> ShowS

show :: FileInfo -> String

showList :: [FileInfo] -> ShowS

ReportSchemaErrors m => FromJSON m FileInfo 
Instance details

Defined in Hackage.Security.TUF.FileInfo

Methods

fromJSON :: JSValue -> m FileInfo

Monad m => ToJSON m FileInfo 
Instance details

Defined in Hackage.Security.TUF.FileInfo

Methods

toJSON :: FileInfo -> m JSValue

newtype FileLength #

Constructors

FileLength 

Fields

Instances
Eq FileLength 
Instance details

Defined in Hackage.Security.TUF.Common

Methods

(==) :: FileLength -> FileLength -> Bool

(/=) :: FileLength -> FileLength -> Bool

Ord FileLength 
Instance details

Defined in Hackage.Security.TUF.Common

Show FileLength 
Instance details

Defined in Hackage.Security.TUF.Common

Methods

showsPrec :: Int -> FileLength -> ShowS

show :: FileLength -> String

showList :: [FileLength] -> ShowS

ReportSchemaErrors m => FromJSON m FileLength 
Instance details

Defined in Hackage.Security.TUF.Common

Methods

fromJSON :: JSValue -> m FileLength

Monad m => ToJSON m FileLength 
Instance details

Defined in Hackage.Security.TUF.Common

Methods

toJSON :: FileLength -> m JSValue

fileInfoSHA256 :: FileInfo -> Maybe Hash #