stack-1.4.0: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Types.PackageIndex

Contents

- PackageIndex, IndexName & IndexLocation

Synopsis

- data PackageDownload = PackageDownload {
  - pdSHA256 :: !ByteString
  - pdUrl :: !ByteString
  - pdSize :: !Word64
  }
- newtype HSPackageDownload = HSPackageDownload {
  - unHSPackageDownload :: PackageDownload
  }
- data PackageCache = PackageCache {
  - pcOffsetSize :: !OffsetSize
  - pcDownload :: !(Maybe PackageDownload)
  }
- data PackageCacheMap = PackageCacheMap {
  - pcmIdent :: !(Map PackageIdentifier PackageCache)
  - pcmSHA :: !(HashMap GitSHA1 OffsetSize)
  }
- data OffsetSize = OffsetSize !Int64 !Int64
- data PackageIndex = PackageIndex {
  - indexName :: !IndexName
  - indexLocation :: !IndexLocation
  - indexDownloadPrefix :: !Text
  - indexGpgVerify :: !Bool
  - indexRequireHashes :: !Bool
  }
- newtype IndexName = IndexName {
  - unIndexName :: ByteString
  }
- indexNameText :: IndexName -> Text
- data IndexLocation
  - = ILGit !Text
  - | ILHttp !Text !HttpType
  - | ILGitHttp !Text !Text !HttpType
- data SimplifiedIndexLocation
  - = SILGit !Text
  - | SILHttp !Text !HttpType
- simplifyIndexLocation :: IndexLocation -> SimplifiedIndexLocation
- data HttpType
  - = HTHackageSecurity !HackageSecurity
  - | HTVanilla
- data HackageSecurity = HackageSecurity {
  - hsKeyIds :: ![Text]
  - hsKeyThreshold :: !Int
  }

# Documentation

data PackageDownload #

Constructors

PackageDownload |
Fields pdSHA256 :: !ByteString pdUrl :: !ByteString pdSize :: !Word64

Instances

Eq PackageDownload # |
Methods (==) :: PackageDownload -> PackageDownload -> Bool # (/=) :: PackageDownload -> PackageDownload -> Bool #
Data PackageDownload # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageDownload -> c PackageDownload # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageDownload # toConstr :: PackageDownload -> Constr # dataTypeOf :: PackageDownload -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PackageDownload) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageDownload) # gmapT :: (forall b. Data b => b -> b) -> PackageDownload -> PackageDownload # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageDownload -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageDownload -> r # gmapQ :: (forall d. Data d => d -> u) -> PackageDownload -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageDownload -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageDownload -> m PackageDownload # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageDownload -> m PackageDownload # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageDownload -> m PackageDownload #
Show PackageDownload # |
Methods showsPrec :: Int -> PackageDownload -> ShowS # show :: PackageDownload -> String # showList :: [PackageDownload] -> ShowS #
Generic PackageDownload # |
Associated Types type Rep PackageDownload :: * -> * # Methods from :: PackageDownload -> Rep PackageDownload x # to :: Rep PackageDownload x -> PackageDownload #
FromJSON PackageDownload # |
Methods parseJSON :: Value -> Parser PackageDownload # parseJSONList :: Value -> Parser [PackageDownload] #
NFData PackageDownload # |
Methods rnf :: PackageDownload -> () #
Store PackageDownload # |
Methods size :: Size PackageDownload # poke :: PackageDownload -> Poke () # peek :: Peek PackageDownload #
type Rep PackageDownload # |
type Rep PackageDownload = D1 (MetaData "PackageDownload" "Stack.Types.PackageIndex" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) (C1 (MetaCons "PackageDownload" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "pdSHA256") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString)) ((:*:) (S1 (MetaSel (Just Symbol "pdUrl") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString)) (S1 (MetaSel (Just Symbol "pdSize") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word64)))))

newtype HSPackageDownload #

Hackage Security provides a different JSON format, we'll have our own JSON parser for it.

Constructors

HSPackageDownload |
Fields unHSPackageDownload :: PackageDownload

Instances

FromJSON HSPackageDownload # |
Methods parseJSON :: Value -> Parser HSPackageDownload # parseJSONList :: Value -> Parser [HSPackageDownload] #

data PackageCache #

Constructors

PackageCache |
Fields pcOffsetSize :: !OffsetSize pcDownload :: !(Maybe PackageDownload)

Instances

Eq PackageCache # |
Methods (==) :: PackageCache -> PackageCache -> Bool # (/=) :: PackageCache -> PackageCache -> Bool #
Data PackageCache # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageCache -> c PackageCache # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageCache # toConstr :: PackageCache -> Constr # dataTypeOf :: PackageCache -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PackageCache) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageCache) # gmapT :: (forall b. Data b => b -> b) -> PackageCache -> PackageCache # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageCache -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageCache -> r # gmapQ :: (forall d. Data d => d -> u) -> PackageCache -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageCache -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageCache -> m PackageCache # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageCache -> m PackageCache # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageCache -> m PackageCache #
Show PackageCache # |
Methods showsPrec :: Int -> PackageCache -> ShowS # show :: PackageCache -> String # showList :: [PackageCache] -> ShowS #
Generic PackageCache # |
Associated Types type Rep PackageCache :: * -> * # Methods from :: PackageCache -> Rep PackageCache x # to :: Rep PackageCache x -> PackageCache #
NFData PackageCache # |
Methods rnf :: PackageCache -> () #
Store PackageCache # |
Methods size :: Size PackageCache # poke :: PackageCache -> Poke () # peek :: Peek PackageCache #
type Rep PackageCache # |
type Rep PackageCache = D1 (MetaData "PackageCache" "Stack.Types.PackageIndex" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) (C1 (MetaCons "PackageCache" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "pcOffsetSize") SourceUnpack SourceStrict DecidedUnpack) (Rec0 OffsetSize)) (S1 (MetaSel (Just Symbol "pcDownload") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe PackageDownload)))))

data PackageCacheMap #

Constructors

PackageCacheMap |
Fields pcmIdent :: !(Map PackageIdentifier PackageCache) most recent revision of the package pcmSHA :: !(HashMap GitSHA1 OffsetSize) lookup via the GitSHA1 of the cabal file contents

Instances

Eq PackageCacheMap # |
Methods (==) :: PackageCacheMap -> PackageCacheMap -> Bool # (/=) :: PackageCacheMap -> PackageCacheMap -> Bool #
Data PackageCacheMap # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PackageCacheMap -> c PackageCacheMap # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PackageCacheMap # toConstr :: PackageCacheMap -> Constr # dataTypeOf :: PackageCacheMap -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PackageCacheMap) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PackageCacheMap) # gmapT :: (forall b. Data b => b -> b) -> PackageCacheMap -> PackageCacheMap # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PackageCacheMap -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PackageCacheMap -> r # gmapQ :: (forall d. Data d => d -> u) -> PackageCacheMap -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageCacheMap -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PackageCacheMap -> m PackageCacheMap # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageCacheMap -> m PackageCacheMap # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PackageCacheMap -> m PackageCacheMap #
Show PackageCacheMap # |
Methods showsPrec :: Int -> PackageCacheMap -> ShowS # show :: PackageCacheMap -> String # showList :: [PackageCacheMap] -> ShowS #
Generic PackageCacheMap # |
Associated Types type Rep PackageCacheMap :: * -> * # Methods from :: PackageCacheMap -> Rep PackageCacheMap x # to :: Rep PackageCacheMap x -> PackageCacheMap #
NFData PackageCacheMap # |
Methods rnf :: PackageCacheMap -> () #
Store PackageCacheMap # |
Methods size :: Size PackageCacheMap # poke :: PackageCacheMap -> Poke () # peek :: Peek PackageCacheMap #
type Rep PackageCacheMap # |
type Rep PackageCacheMap = D1 (MetaData "PackageCacheMap" "Stack.Types.PackageIndex" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) (C1 (MetaCons "PackageCacheMap" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "pcmIdent") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map PackageIdentifier PackageCache))) (S1 (MetaSel (Just Symbol "pcmSHA") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (HashMap GitSHA1 OffsetSize)))))

data OffsetSize #

offset in bytes into the 01-index.tar file for the .cabal file contents, and size in bytes of the .cabal file

Constructors

OffsetSize !Int64 !Int64 |

Instances

Eq OffsetSize # |
Methods (==) :: OffsetSize -> OffsetSize -> Bool # (/=) :: OffsetSize -> OffsetSize -> Bool #
Data OffsetSize # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OffsetSize -> c OffsetSize # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OffsetSize # toConstr :: OffsetSize -> Constr # dataTypeOf :: OffsetSize -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c OffsetSize) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OffsetSize) # gmapT :: (forall b. Data b => b -> b) -> OffsetSize -> OffsetSize # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OffsetSize -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OffsetSize -> r # gmapQ :: (forall d. Data d => d -> u) -> OffsetSize -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OffsetSize -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OffsetSize -> m OffsetSize # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OffsetSize -> m OffsetSize # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OffsetSize -> m OffsetSize #
Show OffsetSize # |
Methods showsPrec :: Int -> OffsetSize -> ShowS # show :: OffsetSize -> String # showList :: [OffsetSize] -> ShowS #
Generic OffsetSize # |
Associated Types type Rep OffsetSize :: * -> * # Methods from :: OffsetSize -> Rep OffsetSize x # to :: Rep OffsetSize x -> OffsetSize #
NFData OffsetSize # |
Methods rnf :: OffsetSize -> () #
Store OffsetSize # |
Methods size :: Size OffsetSize # poke :: OffsetSize -> Poke () # peek :: Peek OffsetSize #
type Rep OffsetSize # |
type Rep OffsetSize = D1 (MetaData "OffsetSize" "Stack.Types.PackageIndex" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) (C1 (MetaCons "OffsetSize" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int64))))

## PackageIndex, IndexName & IndexLocation

data PackageIndex #

Information on a single package index

Constructors

PackageIndex |
Fields indexName :: !IndexName indexLocation :: !IndexLocation indexDownloadPrefix :: !Text URL prefix for downloading packages indexGpgVerify :: !Bool GPG-verify the package index during download. Only applies to Git repositories for now. indexRequireHashes :: !Bool Require that hashes and package size information be available for packages in this index

Instances

Show PackageIndex # |
Methods showsPrec :: Int -> PackageIndex -> ShowS # show :: PackageIndex -> String # showList :: [PackageIndex] -> ShowS #
FromJSON (WithJSONWarnings PackageIndex) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings PackageIndex) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageIndex] #

newtype IndexName #

Unique name for a package index

Constructors

IndexName |
Fields unIndexName :: ByteString

Instances

Eq IndexName # |
Methods (==) :: IndexName -> IndexName -> Bool # (/=) :: IndexName -> IndexName -> Bool #
Ord IndexName # |
Methods compare :: IndexName -> IndexName -> Ordering # (<) :: IndexName -> IndexName -> Bool # (<=) :: IndexName -> IndexName -> Bool # (>) :: IndexName -> IndexName -> Bool # (>=) :: IndexName -> IndexName -> Bool # max :: IndexName -> IndexName -> IndexName # min :: IndexName -> IndexName -> IndexName #
Show IndexName # |
Methods showsPrec :: Int -> IndexName -> ShowS # show :: IndexName -> String # showList :: [IndexName] -> ShowS #
Hashable IndexName # |
Methods hashWithSalt :: Int -> IndexName -> Int # hash :: IndexName -> Int #
FromJSON IndexName # |
Methods parseJSON :: Value -> Parser IndexName # parseJSONList :: Value -> Parser [IndexName] #
ToJSON IndexName # |
Methods toJSON :: IndexName -> Value # toEncoding :: IndexName -> Encoding # toJSONList :: [IndexName] -> Value # toEncodingList :: [IndexName] -> Encoding #
Store IndexName # |
Methods size :: Size IndexName # poke :: IndexName -> Poke () # peek :: Peek IndexName #

indexNameText :: IndexName -> Text #

data IndexLocation #

Location of the package index. This ensures that at least one of Git or HTTP is available.

Constructors

ILGit !Text |
ILHttp !Text !HttpType |
ILGitHttp !Text !Text !HttpType |

Instances

Eq IndexLocation # |
Methods (==) :: IndexLocation -> IndexLocation -> Bool # (/=) :: IndexLocation -> IndexLocation -> Bool #
Ord IndexLocation # |
Methods compare :: IndexLocation -> IndexLocation -> Ordering # (<) :: IndexLocation -> IndexLocation -> Bool # (<=) :: IndexLocation -> IndexLocation -> Bool # (>) :: IndexLocation -> IndexLocation -> Bool # (>=) :: IndexLocation -> IndexLocation -> Bool # max :: IndexLocation -> IndexLocation -> IndexLocation # min :: IndexLocation -> IndexLocation -> IndexLocation #
Show IndexLocation # |
Methods showsPrec :: Int -> IndexLocation -> ShowS # show :: IndexLocation -> String # showList :: [IndexLocation] -> ShowS #

data SimplifiedIndexLocation #

Simplified `IndexLocation`, which will either be a Git repo or HTTP URL.

Constructors

SILGit !Text |
SILHttp !Text !HttpType |

Instances

Eq SimplifiedIndexLocation # |
Methods (==) :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Bool # (/=) :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Bool #
Ord SimplifiedIndexLocation # |
Methods compare :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Ordering # (<) :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Bool # (<=) :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Bool # (>) :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Bool # (>=) :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> Bool # max :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> SimplifiedIndexLocation # min :: SimplifiedIndexLocation -> SimplifiedIndexLocation -> SimplifiedIndexLocation #
Show SimplifiedIndexLocation # |
Methods showsPrec :: Int -> SimplifiedIndexLocation -> ShowS # show :: SimplifiedIndexLocation -> String # showList :: [SimplifiedIndexLocation] -> ShowS #

simplifyIndexLocation :: IndexLocation -> SimplifiedIndexLocation #

data HttpType #

Constructors

HTHackageSecurity !HackageSecurity |
HTVanilla |

Instances

Eq HttpType # |
Methods (==) :: HttpType -> HttpType -> Bool # (/=) :: HttpType -> HttpType -> Bool #
Ord HttpType # |
Methods compare :: HttpType -> HttpType -> Ordering # (<) :: HttpType -> HttpType -> Bool # (<=) :: HttpType -> HttpType -> Bool # (>) :: HttpType -> HttpType -> Bool # (>=) :: HttpType -> HttpType -> Bool # max :: HttpType -> HttpType -> HttpType # min :: HttpType -> HttpType -> HttpType #
Show HttpType # |
Methods showsPrec :: Int -> HttpType -> ShowS # show :: HttpType -> String # showList :: [HttpType] -> ShowS #

data HackageSecurity #

Constructors

HackageSecurity |
Fields hsKeyIds :: ![Text] hsKeyThreshold :: !Int

Instances

Eq HackageSecurity # |
Methods (==) :: HackageSecurity -> HackageSecurity -> Bool # (/=) :: HackageSecurity -> HackageSecurity -> Bool #
Ord HackageSecurity # |
Methods compare :: HackageSecurity -> HackageSecurity -> Ordering # (<) :: HackageSecurity -> HackageSecurity -> Bool # (<=) :: HackageSecurity -> HackageSecurity -> Bool # (>) :: HackageSecurity -> HackageSecurity -> Bool # (>=) :: HackageSecurity -> HackageSecurity -> Bool # max :: HackageSecurity -> HackageSecurity -> HackageSecurity # min :: HackageSecurity -> HackageSecurity -> HackageSecurity #
Show HackageSecurity # |
Methods showsPrec :: Int -> HackageSecurity -> ShowS # show :: HackageSecurity -> String # showList :: [HackageSecurity] -> ShowS #
FromJSON HackageSecurity # |
Methods parseJSON :: Value -> Parser HackageSecurity # parseJSONList :: Value -> Parser [HackageSecurity] #