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

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

Distribution.Client.IndexUtils.Timestamp

Description

Timestamp type used in package indexes

Synopsis

- data Timestamp = NoTimestamp
- epochTimeToTimestamp :: EpochTime -> Timestamp
- timestampToUTCTime :: Timestamp -> Maybe UTCTime
- utcTimeToTimestamp :: UTCTime -> Timestamp
- maximumTimestamp :: [Timestamp] -> Timestamp

# Documentation

data Timestamp #

UNIX timestamp (expressed in seconds since unix epoch, i.e. 1970).

Constructors

NoTimestamp |

#### Instances

Instances details

Parsec Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods parsec :: CabalParsing m => m Timestamp #
Pretty Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods pretty :: Timestamp -> Doc # prettyVersioned :: CabalSpecVersion -> Timestamp -> Doc #
Structured Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods structure :: Proxy Timestamp -> Structure # structureHash' :: Tagged Timestamp MD5
Binary Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods put :: Timestamp -> Put # get :: Get Timestamp # putList :: [Timestamp] -> Put #
NFData Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods rnf :: Timestamp -> () #
Generic Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Associated Types
type Rep Timestamp |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp type Rep Timestamp = D1 ('MetaData "Timestamp" "Distribution.Client.IndexUtils.Timestamp" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "NoTimestamp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
Methods from :: Timestamp -> Rep Timestamp x # to :: Rep Timestamp x -> Timestamp #
Show Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods showsPrec :: Int -> Timestamp -> ShowS # show :: Timestamp -> String # showList :: [Timestamp] -> ShowS #
Eq Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods (==) :: Timestamp -> Timestamp -> Bool # (/=) :: Timestamp -> Timestamp -> Bool #
Ord Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp Methods compare :: Timestamp -> Timestamp -> Ordering # (<) :: Timestamp -> Timestamp -> Bool # (<=) :: Timestamp -> Timestamp -> Bool # (>) :: Timestamp -> Timestamp -> Bool # (>=) :: Timestamp -> Timestamp -> Bool # max :: Timestamp -> Timestamp -> Timestamp # min :: Timestamp -> Timestamp -> Timestamp #
type Rep Timestamp # |
Instance details Defined in Distribution.Client.IndexUtils.Timestamp type Rep Timestamp = D1 ('MetaData "Timestamp" "Distribution.Client.IndexUtils.Timestamp" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "NoTimestamp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

epochTimeToTimestamp :: EpochTime -> Timestamp #

timestampToUTCTime :: Timestamp -> Maybe UTCTime #

utcTimeToTimestamp :: UTCTime -> Timestamp #

maximumTimestamp :: [Timestamp] -> Timestamp #

Compute the maximum `Timestamp` value

Returns `NoTimestamp` for the empty list. Also note that `NoTimestamp` compares as smaller to all non-`NoTimestamp` values.