cabal-install-3.10.2.1: The command-line interface for Cabal and Hackage.

Copyright | (c) 2016 Herbert Valerio Riedel
License | BSD3
Safe Haskell | None
Language | Haskell2010

Distribution.Client.IndexUtils.IndexState

Description

Package repositories index state.

Synopsis

- data RepoIndexState
  - = IndexStateHead
  - | IndexStateTime !Timestamp
- data TotalIndexState
- headTotalIndexState :: TotalIndexState
- makeTotalIndexState :: RepoIndexState -> Map RepoName RepoIndexState -> TotalIndexState
- lookupIndexState :: RepoName -> TotalIndexState -> RepoIndexState
- insertIndexState :: RepoName -> RepoIndexState -> TotalIndexState -> TotalIndexState

# Documentation

data RepoIndexState #

Specification of the state of a specific repo package index

Constructors

IndexStateHead | Use all available entries
IndexStateTime !Timestamp | Use all entries that existed at the specified time

#### Instances

Instances details

Parsec RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods parsec :: CabalParsing m => m RepoIndexState #
Pretty RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods pretty :: RepoIndexState -> Doc # prettyVersioned :: CabalSpecVersion -> RepoIndexState -> Doc #
Structured RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods structure :: Proxy RepoIndexState -> Structure # structureHash' :: Tagged RepoIndexState MD5
Generic RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Associated Types
type Rep RepoIndexState |
Instance details Defined in Distribution.Client.IndexUtils.IndexState type Rep RepoIndexState = D1 ('MetaData "RepoIndexState" "Distribution.Client.IndexUtils.IndexState" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "IndexStateHead" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IndexStateTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Timestamp)))
Methods from :: RepoIndexState -> Rep RepoIndexState x # to :: Rep RepoIndexState x -> RepoIndexState #
Show RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods showsPrec :: Int -> RepoIndexState -> ShowS # show :: RepoIndexState -> String # showList :: [RepoIndexState] -> ShowS #
Binary RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods put :: RepoIndexState -> Put # get :: Get RepoIndexState # putList :: [RepoIndexState] -> Put #
NFData RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods rnf :: RepoIndexState -> () #
Eq RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods (==) :: RepoIndexState -> RepoIndexState -> Bool # (/=) :: RepoIndexState -> RepoIndexState -> Bool #
type Rep RepoIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState type Rep RepoIndexState = D1 ('MetaData "RepoIndexState" "Distribution.Client.IndexUtils.IndexState" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "IndexStateHead" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IndexStateTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Timestamp)))

data TotalIndexState #

Index state of multiple repositories

#### Instances

Instances details

Parsec TotalIndexState # |
    >>> simpleParsec "HEAD" :: Maybe TotalIndexState
    Just (TIS IndexStateHead (fromList []))
    >>> simpleParsec "" :: Maybe TotalIndexState
    Nothing
    >>> simpleParsec "hackage.haskell.org HEAD" :: Maybe TotalIndexState
    Just (TIS IndexStateHead (fromList []))
    >>> simpleParsec "2020-02-04T12:34:56Z, hackage.haskell.org HEAD" :: Maybe TotalIndexState
    Just (TIS (IndexStateTime (TS 1580819696)) (fromList [(RepoName "hackage.haskell.org",IndexStateHead)]))
    >>> simpleParsec "hackage.haskell.org 2020-02-04T12:34:56Z" :: Maybe TotalIndexState
    Just (TIS IndexStateHead (fromList [(RepoName "hackage.haskell.org",IndexStateTime (TS 1580819696))]))
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods parsec :: CabalParsing m => m TotalIndexState #
Pretty TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods pretty :: TotalIndexState -> Doc # prettyVersioned :: CabalSpecVersion -> TotalIndexState -> Doc #
Structured TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods structure :: Proxy TotalIndexState -> Structure # structureHash' :: Tagged TotalIndexState MD5
Generic TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Associated Types
type Rep TotalIndexState |
Instance details Defined in Distribution.Client.IndexUtils.IndexState type Rep TotalIndexState = D1 ('MetaData "TotalIndexState" "Distribution.Client.IndexUtils.IndexState" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "TIS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RepoIndexState) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map RepoName RepoIndexState))))
Methods from :: TotalIndexState -> Rep TotalIndexState x # to :: Rep TotalIndexState x -> TotalIndexState #
Show TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods showsPrec :: Int -> TotalIndexState -> ShowS # show :: TotalIndexState -> String # showList :: [TotalIndexState] -> ShowS #
Binary TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods put :: TotalIndexState -> Put # get :: Get TotalIndexState # putList :: [TotalIndexState] -> Put #
NFData TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods rnf :: TotalIndexState -> () #
Eq TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState Methods (==) :: TotalIndexState -> TotalIndexState -> Bool # (/=) :: TotalIndexState -> TotalIndexState -> Bool #
type Rep TotalIndexState # |
Instance details Defined in Distribution.Client.IndexUtils.IndexState type Rep TotalIndexState = D1 ('MetaData "TotalIndexState" "Distribution.Client.IndexUtils.IndexState" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "TIS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RepoIndexState) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map RepoName RepoIndexState))))

headTotalIndexState :: TotalIndexState #

`TotalIndexState` where all repositories are at `HEAD` index state.

makeTotalIndexState :: RepoIndexState -> Map RepoName RepoIndexState -> TotalIndexState #

Create `TotalIndexState`.

lookupIndexState :: RepoName -> TotalIndexState -> RepoIndexState #

Lookup a `RepoIndexState` for an individual repository from `TotalIndexState`.

insertIndexState :: RepoName -> RepoIndexState -> TotalIndexState -> TotalIndexState #

Insert a `RepoIndexState` to `TotalIndexState`.