cabal-install-parsers-0.4.1: Utilities to work with cabal-install files
Safe HaskellNone
LanguageHaskell2010

Cabal.Index

Synopsis

Metadata construction

indexMetadata Source #

Arguments

:: FilePath

location

-> Maybe EpochTime

index state to stop

-> IO (Map PackageName PackageInfo) 

Read index file and return the metadata about packages.

It takes about 6 seconds on my machine. Consider using cachedHackageMetadata.

cachedHackageMetadata :: IO (FilePath, Map PackageName PackageInfo) Source #

Read the config and then Hackage index metadata.

This method caches the result in XDG_CACHE/cabal-parsers directory.

Returns the location of index tarball and its contents.

Exceptions thrown

data MetadataParseError Source #

Thrown when we cannot parse package.json or preferred-versions files.

data InvalidHash Source #

Thrown if we fail consistency check, we don't know a hash for some file.

newtype InvalidIndexFile Source #

Thrown when when not a .cabal, package.json or preferred-versions file is encountered.

Constructors

InvalidIndexFile String 

Metadata types

data PackageInfo Source #

Package information.

Constructors

PackageInfo 

Fields

Instances

Instances details
Eq PackageInfo Source # 
Instance details

Defined in Cabal.Index

Show PackageInfo Source # 
Instance details

Defined in Cabal.Index

Generic PackageInfo Source # 
Instance details

Defined in Cabal.Index

Associated Types

type Rep PackageInfo :: Type -> Type #

Binary PackageInfo Source # 
Instance details

Defined in Cabal.Index

type Rep PackageInfo Source # 
Instance details

Defined in Cabal.Index

type Rep PackageInfo = D1 ('MetaData "PackageInfo" "Cabal.Index" "cabal-install-parsers-0.4.1-BP7tLbeRrCUJ33WiVuP9m7" 'False) (C1 ('MetaCons "PackageInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "piVersions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Version ReleaseInfo)) :*: S1 ('MetaSel ('Just "piPreferred") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VersionRange)))

data ReleaseInfo Source #

Package's release information.

Constructors

ReleaseInfo 

Fields

Instances

Instances details
Eq ReleaseInfo Source # 
Instance details

Defined in Cabal.Index

Show ReleaseInfo Source # 
Instance details

Defined in Cabal.Index

Generic ReleaseInfo Source # 
Instance details

Defined in Cabal.Index

Associated Types

type Rep ReleaseInfo :: Type -> Type #

Binary ReleaseInfo Source # 
Instance details

Defined in Cabal.Index

type Rep ReleaseInfo Source # 
Instance details

Defined in Cabal.Index

type Rep ReleaseInfo = D1 ('MetaData "ReleaseInfo" "Cabal.Index" "cabal-install-parsers-0.4.1-BP7tLbeRrCUJ33WiVuP9m7" 'False) (C1 ('MetaCons "ReleaseInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "riRevision") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "riTarOffset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TarEntryOffset)) :*: (S1 ('MetaSel ('Just "riCabal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SHA256) :*: S1 ('MetaSel ('Just "riTarball") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SHA256))))

Hashes

data SHA256 Source #

SHA256 digest. 256 bytes.

Constructors

SHA256 !Word64 !Word64 !Word64 !Word64 

Instances

Instances details
Eq SHA256 Source # 
Instance details

Defined in Cabal.Index

Methods

(==) :: SHA256 -> SHA256 -> Bool #

(/=) :: SHA256 -> SHA256 -> Bool #

Ord SHA256 Source # 
Instance details

Defined in Cabal.Index

Show SHA256 Source # 
Instance details

Defined in Cabal.Index

Pretty SHA256 Source # 
Instance details

Defined in Cabal.Index

Binary SHA256 Source # 
Instance details

Defined in Cabal.Index

Methods

put :: SHA256 -> Put #

get :: Get SHA256 #

putList :: [SHA256] -> Put #

mkSHA256 :: Text -> Either String SHA256 Source #

Make SHA256 from base16-encoded string.

unsafeMkSHA256 :: Text -> SHA256 Source #

Unsafe variant of mkSHA256.

getSHA256 :: SHA256 -> ByteString Source #

Get ByteString representation of SHA256.

Generic folding

foldIndex Source #

Arguments

:: FilePath

path to the 01-index.tar file

-> a

initial value

-> (IndexEntry -> ByteString -> a -> IO a) 
-> IO a 

Fold over Hackage 01-index.tar file.

May throw FormatError or InvalidIndexFile.

data IndexFileType Source #

Varions files in 01-index.tar.

Instances

Instances details
Show IndexFileType Source # 
Instance details

Defined in Cabal.Index