thyme-0.3.5.5: A faster time library

Safe Haskell | None
Language | Haskell2010

Data.Thyme.Clock

Contents

- Universal Time
- Absolute intervals
- UTC
- Time interval conversion
- Lenses

Description

Types and functions for UTC and UT1.

If you don't care about leap seconds, keep to `UTCView` and `NominalDiffTime` for your clock calculations, and you'll be fine.

`Num`, `Real`, `Fractional` and `RealFrac` instances for `DiffTime` and `NominalDiffTime` are only available by importing Data.Thyme.Time. In their stead are instances of `AdditiveGroup`, `HasBasis` and `VectorSpace`, with ``Scalar` `DiffTime` ≡ `Scalar` `NominalDiffTime` ≡ `Rational``.

Using `fromSeconds` and `toSeconds` to convert between `TimeDiff`s and other numeric types. If you really must coerce between `DiffTime` and `NominalDiffTime`, ``view` (`microseconds` . `from` `microseconds`)`.

`UTCView` is an instance of `AffineSpace`, with ``Diff` `UTCView` ≡ `NominalDiffTime``.

`UTCView` is not Y294K-compliant. Please file a bug report on GitHub when this becomes a problem.

Synopsis

- data UniversalTime
- modJulianDate :: Iso' UniversalTime Rational
- data DiffTime
- data UTCTime
- data UTCView = UTCTime {
  - utctDay :: !Day
  - utctDayTime :: !DiffTime
  }
- utcTime :: Iso' UTCTime UTCView
- data NominalDiffTime
- getCurrentTime :: IO UTCTime
- class (HasBasis t, Basis t ~ (), Scalar t ~ Rational) => TimeDiff t where
  - microseconds :: Iso' t Int64
- toSeconds :: (TimeDiff t, Fractional n) => t -> n
- fromSeconds :: (Real n, TimeDiff t) => n -> t
- toSeconds' :: TimeDiff t => t -> Rational
- fromSeconds' :: TimeDiff t => Rational -> t
- _utctDay :: Lens' UTCTime Day
- _utctDayTime :: Lens' UTCTime DiffTime

# Universal Time

data UniversalTime Source #

The principal form of universal time, namely UT1.

`UniversalTime` is defined by the rotation of the Earth around its axis relative to the Sun. Thus the length of a day by this definition varies from one to the next, and is never exactly 86400 SI seconds unlike TAI or `AbsoluteTime`. The difference between UT1 and UTC is DUT1.

Instances

Bounded UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods minBound :: UniversalTime Source # maxBound :: UniversalTime Source #
Enum UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

succ :: UniversalTime -> UniversalTime Source #

pred :: UniversalTime -> UniversalTime Source #

toEnum :: Int -> UniversalTime Source #

fromEnum :: UniversalTime -> Int Source #

enumFrom :: UniversalTime -> [UniversalTime] Source #

enumFromThen :: UniversalTime -> UniversalTime -> [UniversalTime] Source #

enumFromTo :: UniversalTime -> UniversalTime -> [UniversalTime] Source #

enumFromThenTo :: UniversalTime -> UniversalTime -> UniversalTime -> [UniversalTime] Source #

Eq UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods (==) :: UniversalTime -> UniversalTime -> Bool Source # (/=) :: UniversalTime -> UniversalTime -> Bool Source #
Data UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniversalTime -> c UniversalTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UniversalTime Source #

toConstr :: UniversalTime -> Constr Source #

dataTypeOf :: UniversalTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UniversalTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UniversalTime) Source #

gmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UniversalTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniversalTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

Ord UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

compare :: UniversalTime -> UniversalTime -> Ordering Source #

(<) :: UniversalTime -> UniversalTime -> Bool Source #

(<=) :: UniversalTime -> UniversalTime -> Bool Source #

(>) :: UniversalTime -> UniversalTime -> Bool Source #

(>=) :: UniversalTime -> UniversalTime -> Bool Source #

max :: UniversalTime -> UniversalTime -> UniversalTime Source #

min :: UniversalTime -> UniversalTime -> UniversalTime Source #

Ix UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

range :: (UniversalTime, UniversalTime) -> [UniversalTime] Source #

index :: (UniversalTime, UniversalTime) -> UniversalTime -> Int Source #

unsafeIndex :: (UniversalTime, UniversalTime) -> UniversalTime -> Int

inRange :: (UniversalTime, UniversalTime) -> UniversalTime -> Bool Source #

rangeSize :: (UniversalTime, UniversalTime) -> Int Source #

unsafeRangeSize :: (UniversalTime, UniversalTime) -> Int

Generic UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Rep UniversalTime :: Type -> Type Source # Methods from :: UniversalTime -> Rep UniversalTime x Source # to :: Rep UniversalTime x -> UniversalTime Source #
Arbitrary UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods arbitrary :: Gen UniversalTime Source # shrink :: UniversalTime -> [UniversalTime] Source #
CoArbitrary UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods coarbitrary :: UniversalTime -> Gen b -> Gen b Source #
NFData UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods rnf :: UniversalTime -> () Source #
Random UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

randomR :: RandomGen g => (UniversalTime, UniversalTime) -> g -> (UniversalTime, g) Source #

random :: RandomGen g => g -> (UniversalTime, g) Source #

randomRs :: RandomGen g => (UniversalTime, UniversalTime) -> g -> [UniversalTime] Source #

randoms :: RandomGen g => g -> [UniversalTime] Source #

randomRIO :: (UniversalTime, UniversalTime) -> IO UniversalTime Source #

randomIO :: IO UniversalTime Source #

Unbox UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal
ParseTime UniversalTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> UniversalTime Source #
FormatTime UniversalTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> UniversalTime -> (Char -> ShowS) -> Char -> ShowS Source #
Vector Vector UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) UniversalTime -> m (Vector UniversalTime) Source #

basicUnsafeThaw :: PrimMonad m => Vector UniversalTime -> m (Mutable Vector (PrimState m) UniversalTime) Source #

basicLength :: Vector UniversalTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector UniversalTime -> Vector UniversalTime Source #

basicUnsafeIndexM :: Monad m => Vector UniversalTime -> Int -> m UniversalTime Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) UniversalTime -> Vector UniversalTime -> m () Source #

elemseq :: Vector UniversalTime -> UniversalTime -> b -> b Source #

MVector MVector UniversalTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicLength :: MVector s UniversalTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s UniversalTime -> MVector s UniversalTime Source #

basicOverlaps :: MVector s UniversalTime -> MVector s UniversalTime -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) UniversalTime) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) UniversalTime -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> UniversalTime -> m (MVector (PrimState m) UniversalTime) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) UniversalTime -> Int -> m UniversalTime Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) UniversalTime -> Int -> UniversalTime -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) UniversalTime -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) UniversalTime -> UniversalTime -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) UniversalTime -> MVector (PrimState m) UniversalTime -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) UniversalTime -> MVector (PrimState m) UniversalTime -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) UniversalTime -> Int -> m (MVector (PrimState m) UniversalTime) Source #

Thyme UniversalTime UniversalTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' UniversalTime0 UniversalTime Source #
type Rep UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Rep UniversalTime = D1 (MetaData "UniversalTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-Fg1pPOWWkee1p55oP1P4W4" True) (C1 (MetaCons "UniversalRep" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NominalDiffTime)))
newtype Vector UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype Vector UniversalTime = V_UniversalTime (Vector NominalDiffTime)
newtype MVector s UniversalTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype MVector s UniversalTime = MV_UniversalTime (MVector s NominalDiffTime)

modJulianDate :: Iso' UniversalTime Rational Source #

View `UniversalTime` as a fractional number of days since the Modified Julian Date epoch.

# Absolute intervals

data DiffTime Source #

An absolute time interval as measured by a clock.

`DiffTime` forms an `AdditiveGroup`―so can be added using `^+^` (or `^-^` for subtraction), and also an instance of `VectorSpace`―so can be scaled using `*^`, where

    type Scalar DiffTime = Rational

Instances

Bounded DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods minBound :: DiffTime Source # maxBound :: DiffTime Source #
Enum DiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

succ :: DiffTime -> DiffTime Source #

pred :: DiffTime -> DiffTime Source #

toEnum :: Int -> DiffTime Source #

fromEnum :: DiffTime -> Int Source #

enumFrom :: DiffTime -> [DiffTime] Source #

enumFromThen :: DiffTime -> DiffTime -> [DiffTime] Source #

enumFromTo :: DiffTime -> DiffTime -> [DiffTime] Source #

enumFromThenTo :: DiffTime -> DiffTime -> DiffTime -> [DiffTime] Source #

Eq DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods (==) :: DiffTime -> DiffTime -> Bool Source # (/=) :: DiffTime -> DiffTime -> Bool Source #
Fractional DiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods (/) :: DiffTime -> DiffTime -> DiffTime Source # recip :: DiffTime -> DiffTime Source # fromRational :: Rational -> DiffTime Source #
Data DiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime Source #

toConstr :: DiffTime -> Constr Source #

dataTypeOf :: DiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

Num DiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods (+) :: DiffTime -> DiffTime -> DiffTime Source # (-) :: DiffTime -> DiffTime -> DiffTime Source # (*) :: DiffTime -> DiffTime -> DiffTime Source # negate :: DiffTime -> DiffTime Source # abs :: DiffTime -> DiffTime Source # signum :: DiffTime -> DiffTime Source # fromInteger :: Integer -> DiffTime Source #
Ord DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods compare :: DiffTime -> DiffTime -> Ordering Source # (<) :: DiffTime -> DiffTime -> Bool Source # (<=) :: DiffTime -> DiffTime -> Bool Source # (>) :: DiffTime -> DiffTime -> Bool Source # (>=) :: DiffTime -> DiffTime -> Bool Source # max :: DiffTime -> DiffTime -> DiffTime Source # min :: DiffTime -> DiffTime -> DiffTime Source #
Read DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods readsPrec :: Int -> ReadS DiffTime Source # readList :: ReadS [DiffTime] Source # readPrec :: ReadPrec DiffTime Source # readListPrec :: ReadPrec [DiffTime] Source #
Real DiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods toRational :: DiffTime -> Rational Source #
RealFrac DiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods properFraction :: Integral b => DiffTime -> (b, DiffTime) Source # truncate :: Integral b => DiffTime -> b Source # round :: Integral b => DiffTime -> b Source # ceiling :: Integral b => DiffTime -> b Source # floor :: Integral b => DiffTime -> b Source #
Show DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods showsPrec :: Int -> DiffTime -> ShowS Source # show :: DiffTime -> String Source # showList :: [DiffTime] -> ShowS Source #
Ix DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods range :: (DiffTime, DiffTime) -> [DiffTime] Source # index :: (DiffTime, DiffTime) -> DiffTime -> Int Source # unsafeIndex :: (DiffTime, DiffTime) -> DiffTime -> Int inRange :: (DiffTime, DiffTime) -> DiffTime -> Bool Source # rangeSize :: (DiffTime, DiffTime) -> Int Source # unsafeRangeSize :: (DiffTime, DiffTime) -> Int
Generic DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Rep DiffTime :: Type -> Type Source # Methods from :: DiffTime -> Rep DiffTime x Source # to :: Rep DiffTime x -> DiffTime Source #
Arbitrary DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods arbitrary :: Gen DiffTime Source # shrink :: DiffTime -> [DiffTime] Source #
CoArbitrary DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods coarbitrary :: DiffTime -> Gen b -> Gen b Source #
NFData DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods rnf :: DiffTime -> () Source #
Random DiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

randomR :: RandomGen g => (DiffTime, DiffTime) -> g -> (DiffTime, g) Source #

random :: RandomGen g => g -> (DiffTime, g) Source #

randomRs :: RandomGen g => (DiffTime, DiffTime) -> g -> [DiffTime] Source #

randoms :: RandomGen g => g -> [DiffTime] Source #

randomRIO :: (DiffTime, DiffTime) -> IO DiffTime Source #

randomIO :: IO DiffTime Source #

Unbox DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal
HasBasis DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Basis DiffTime :: Type Source # Methods basisValue :: Basis DiffTime -> DiffTime Source # decompose :: DiffTime -> [(Basis DiffTime, Scalar DiffTime)] Source # decompose' :: DiffTime -> Basis DiffTime -> Scalar DiffTime Source #
VectorSpace DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Scalar DiffTime :: Type Source # Methods (*^) :: Scalar DiffTime -> DiffTime -> DiffTime Source #
AdditiveGroup DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods zeroV :: DiffTime Source # (^+^) :: DiffTime -> DiffTime -> DiffTime Source # negateV :: DiffTime -> DiffTime Source # (^-^) :: DiffTime -> DiffTime -> DiffTime Source #
TimeDiff DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods microseconds :: Iso' DiffTime Int64 Source #
Vector Vector DiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) DiffTime -> m (Vector DiffTime) Source #

basicUnsafeThaw :: PrimMonad m => Vector DiffTime -> m (Mutable Vector (PrimState m) DiffTime) Source #

basicLength :: Vector DiffTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector DiffTime -> Vector DiffTime Source #

basicUnsafeIndexM :: Monad m => Vector DiffTime -> Int -> m DiffTime Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) DiffTime -> Vector DiffTime -> m () Source #

elemseq :: Vector DiffTime -> DiffTime -> b -> b Source #

MVector MVector DiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicLength :: MVector s DiffTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s DiffTime -> MVector s DiffTime Source #

basicOverlaps :: MVector s DiffTime -> MVector s DiffTime -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) DiffTime) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) DiffTime -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> DiffTime -> m (MVector (PrimState m) DiffTime) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) DiffTime -> Int -> m DiffTime Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) DiffTime -> Int -> DiffTime -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) DiffTime -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) DiffTime -> DiffTime -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) DiffTime -> MVector (PrimState m) DiffTime -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) DiffTime -> MVector (PrimState m) DiffTime -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) DiffTime -> Int -> m (MVector (PrimState m) DiffTime) Source #

Thyme DiffTime DiffTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' DiffTime0 DiffTime Source #
type Rep DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Rep DiffTime = D1 (MetaData "DiffTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-Fg1pPOWWkee1p55oP1P4W4" True) (C1 (MetaCons "DiffTime" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Micro)))
newtype Vector DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype Vector DiffTime = V_DiffTime (Vector Micro)
type Basis DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Basis DiffTime = ()
type Scalar DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Scalar DiffTime = Rational
newtype MVector s DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype MVector s DiffTime = MV_DiffTime (MVector s Micro)

# UTC

data UTCTime Source #

Coördinated universal time: the most common form of universal time for civil timekeeping. It is synchronised with `AbsoluteTime` and both tick in increments of SI seconds, but UTC includes occasional leap-seconds so that it does not drift too far from `UniversalTime`.

`UTCView` is an instance of `AffineSpace`, with

    type Diff UTCView = NominalDiffTime

Use `.+^` to add (or `.-^` to subtract) time intervals of type `NominalDiffTime`, and `.-.` to get the interval between `UTCView`s.

`Performance`
  Internally this is a 64-bit count of `microseconds` since the MJD epoch, so `.+^`, `.-^` and `.-.` ought to be fairly fast.
`Issues`
  `UTCView` currently cannot represent leap seconds.

Instances

Bounded UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods minBound :: UTCTime Source # maxBound :: UTCTime Source #
Enum UTCTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

succ :: UTCTime -> UTCTime Source #

pred :: UTCTime -> UTCTime Source #

toEnum :: Int -> UTCTime Source #

fromEnum :: UTCTime -> Int Source #

enumFrom :: UTCTime -> [UTCTime] Source #

enumFromThen :: UTCTime -> UTCTime -> [UTCTime] Source #

enumFromTo :: UTCTime -> UTCTime -> [UTCTime] Source #

enumFromThenTo :: UTCTime -> UTCTime -> UTCTime -> [UTCTime] Source #

Eq UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods (==) :: UTCTime -> UTCTime -> Bool Source # (/=) :: UTCTime -> UTCTime -> Bool Source #
Data UTCTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCTime -> c UTCTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime Source #

toConstr :: UTCTime -> Constr Source #

dataTypeOf :: UTCTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime) Source #

gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

Ord UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods compare :: UTCTime -> UTCTime -> Ordering Source # (<) :: UTCTime -> UTCTime -> Bool Source # (<=) :: UTCTime -> UTCTime -> Bool Source # (>) :: UTCTime -> UTCTime -> Bool Source # (>=) :: UTCTime -> UTCTime -> Bool Source # max :: UTCTime -> UTCTime -> UTCTime Source # min :: UTCTime -> UTCTime -> UTCTime Source #
Read UTCTime Source # |
Instance details Defined in Data.Thyme.Format Methods readsPrec :: Int -> ReadS UTCTime Source # readList :: ReadS [UTCTime] Source # readPrec :: ReadPrec UTCTime Source # readListPrec :: ReadPrec [UTCTime] Source #
Show UTCTime Source # |
Instance details Defined in Data.Thyme.LocalTime Methods showsPrec :: Int -> UTCTime -> ShowS Source # show :: UTCTime -> String Source # showList :: [UTCTime] -> ShowS Source #
Ix UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods range :: (UTCTime, UTCTime) -> [UTCTime] Source # index :: (UTCTime, UTCTime) -> UTCTime -> Int Source # unsafeIndex :: (UTCTime, UTCTime) -> UTCTime -> Int inRange :: (UTCTime, UTCTime) -> UTCTime -> Bool Source # rangeSize :: (UTCTime, UTCTime) -> Int Source # unsafeRangeSize :: (UTCTime, UTCTime) -> Int
Generic UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Rep UTCTime :: Type -> Type Source # Methods from :: UTCTime -> Rep UTCTime x Source # to :: Rep UTCTime x -> UTCTime Source #
Arbitrary UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods arbitrary :: Gen UTCTime Source # shrink :: UTCTime -> [UTCTime] Source #
CoArbitrary UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods coarbitrary :: UTCTime -> Gen b -> Gen b Source #
ToJSON UTCTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods toJSON :: UTCTime -> Value Source # toEncoding :: UTCTime -> Encoding Source # toJSONList :: [UTCTime] -> Value Source # toEncodingList :: [UTCTime] -> Encoding Source #
FromJSON UTCTime Source # |
Instance details Defined in Data.Thyme.Format.Aeson Methods parseJSON :: Value -> Parser UTCTime Source # parseJSONList :: Value -> Parser [UTCTime] Source #
NFData UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods rnf :: UTCTime -> () Source #
Random UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods randomR :: RandomGen g => (UTCTime, UTCTime) -> g -> (UTCTime, g) Source # random :: RandomGen g => g -> (UTCTime, g) Source # randomRs :: RandomGen g => (UTCTime, UTCTime) -> g -> [UTCTime] Source # randoms :: RandomGen g => g -> [UTCTime] Source # randomRIO :: (UTCTime, UTCTime) -> IO UTCTime Source # randomIO :: IO UTCTime Source #
Unbox UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal
AffineSpace UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Diff UTCTime :: Type Source # Methods (.-.) :: UTCTime -> UTCTime -> Diff UTCTime Source # (.+^) :: UTCTime -> Diff UTCTime -> UTCTime Source #
ParseTime UTCTime Source # |
Instance details Defined in Data.Thyme.Format Methods buildTime :: TimeParse -> UTCTime Source #
FormatTime UTCTime Source # |
Instance details Defined in Data.Thyme.Format Methods showsTime :: TimeLocale -> UTCTime -> (Char -> ShowS) -> Char -> ShowS Source #
Vector Vector UTCTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) UTCTime -> m (Vector UTCTime) Source #

basicUnsafeThaw :: PrimMonad m => Vector UTCTime -> m (Mutable Vector (PrimState m) UTCTime) Source #

basicLength :: Vector UTCTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector UTCTime -> Vector UTCTime Source #

basicUnsafeIndexM :: Monad m => Vector UTCTime -> Int -> m UTCTime Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) UTCTime -> Vector UTCTime -> m () Source #

elemseq :: Vector UTCTime -> UTCTime -> b -> b Source #

MVector MVector UTCTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicLength :: MVector s UTCTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s UTCTime -> MVector s UTCTime Source #

basicOverlaps :: MVector s UTCTime -> MVector s UTCTime -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) UTCTime) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) UTCTime -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> UTCTime -> m (MVector (PrimState m) UTCTime) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) UTCTime -> Int -> m UTCTime Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) UTCTime -> Int -> UTCTime -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) UTCTime -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) UTCTime -> UTCTime -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) UTCTime -> MVector (PrimState m) UTCTime -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) UTCTime -> MVector (PrimState m) UTCTime -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) UTCTime -> Int -> m (MVector (PrimState m) UTCTime) Source #

Thyme UTCTime UTCTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' UTCTime0 UTCTime Source #
type Rep UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Rep UTCTime = D1 (MetaData "UTCTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-Fg1pPOWWkee1p55oP1P4W4" True) (C1 (MetaCons "UTCRep" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NominalDiffTime)))
newtype Vector UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype Vector UTCTime = V_UTCTime (Vector NominalDiffTime)
type Diff UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Diff UTCTime = NominalDiffTime
newtype MVector s UTCTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype MVector s UTCTime = MV_UTCTime (MVector s NominalDiffTime)

data UTCView Source #

Unpacked `UTCView`, partly for compatibility with `time`.

Constructors

UTCTime |

Fields

- utctDay :: !Day
- utctDayTime :: !DiffTime

Instances

Eq UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods (==) :: UTCView -> UTCView -> Bool Source # (/=) :: UTCView -> UTCView -> Bool Source #
Data UTCView Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCView -> c UTCView Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCView Source #

toConstr :: UTCView -> Constr Source #

dataTypeOf :: UTCView -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCView) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCView) Source #

gmapT :: (forall b. Data b => b -> b) -> UTCView -> UTCView Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCView -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCView -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UTCView -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCView -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCView -> m UTCView Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCView -> m UTCView Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCView -> m UTCView Source #

Ord UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods compare :: UTCView -> UTCView -> Ordering Source # (<) :: UTCView -> UTCView -> Bool Source # (<=) :: UTCView -> UTCView -> Bool Source # (>) :: UTCView -> UTCView -> Bool Source # (>=) :: UTCView -> UTCView -> Bool Source # max :: UTCView -> UTCView -> UTCView Source # min :: UTCView -> UTCView -> UTCView Source #
Read UTCView Source # |
Instance details Defined in Data.Thyme.Format Methods readsPrec :: Int -> ReadS UTCView Source # readList :: ReadS [UTCView] Source # readPrec :: ReadPrec UTCView Source # readListPrec :: ReadPrec [UTCView] Source #
Show UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods showsPrec :: Int -> UTCView -> ShowS Source # show :: UTCView -> String Source # showList :: [UTCView] -> ShowS Source #
Generic UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Rep UTCView :: Type -> Type Source # Methods from :: UTCView -> Rep UTCView x Source # to :: Rep UTCView x -> UTCView Source #
NFData UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods rnf :: UTCView -> () Source #
Unbox UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal
Vector Vector UTCView Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) UTCView -> m (Vector UTCView) Source #

basicUnsafeThaw :: PrimMonad m => Vector UTCView -> m (Mutable Vector (PrimState m) UTCView) Source #

basicLength :: Vector UTCView -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector UTCView -> Vector UTCView Source #

basicUnsafeIndexM :: Monad m => Vector UTCView -> Int -> m UTCView Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) UTCView -> Vector UTCView -> m () Source #

elemseq :: Vector UTCView -> UTCView -> b -> b Source #

MVector MVector UTCView Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicLength :: MVector s UTCView -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s UTCView -> MVector s UTCView Source #

basicOverlaps :: MVector s UTCView -> MVector s UTCView -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) UTCView) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) UTCView -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> UTCView -> m (MVector (PrimState m) UTCView) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) UTCView -> Int -> m UTCView Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) UTCView -> Int -> UTCView -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) UTCView -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) UTCView -> UTCView -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) UTCView -> MVector (PrimState m) UTCView -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) UTCView -> MVector (PrimState m) UTCView -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) UTCView -> Int -> m (MVector (PrimState m) UTCView) Source #

Thyme UTCTime UTCView Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' UTCTime UTCView Source #
type Rep UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Rep UTCView = D1 (MetaData "UTCView" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-Fg1pPOWWkee1p55oP1P4W4" False) (C1 (MetaCons "UTCTime" PrefixI True) (S1 (MetaSel (Just "utctDay") SourceUnpack SourceStrict DecidedStrict) (Rec0 Day) :*: S1 (MetaSel (Just "utctDayTime") SourceUnpack SourceStrict DecidedStrict) (Rec0 DiffTime)))
newtype Vector UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype Vector UTCView = V_UTCView (Vector (Day, DiffTime))
newtype MVector s UTCView Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype MVector s UTCView = MV_UTCView (MVector s (Day, DiffTime))

utcTime :: Iso' UTCTime UTCView Source #

View `UTCView` as an `UTCView`, comprising a `Day` along with a `DiffTime` offset since midnight.

This is an improper lens: `utctDayTime` offsets outside the range of `[`zeroV`, `posixDayLength`)` will carry over into the day part, with the expected behaviour.

data NominalDiffTime Source #

A time interval as measured by UTC, that does not take leap-seconds into account.

For instance, the difference between `23:59:59` and `00:00:01` on the following day is always 2 seconds of `NominalDiffTime`, regardless of whether a leap-second took place.

`NominalDiffTime` forms an `AdditiveGroup`―so can be added using `^+^` (or `^-^` for subtraction), and also an instance of `VectorSpace`―so can be scaled using `*^`, where

    type Scalar NominalDiffTime = Rational

Instances

Bounded NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods minBound :: NominalDiffTime Source # maxBound :: NominalDiffTime Source #
Enum NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

succ :: NominalDiffTime -> NominalDiffTime Source #

pred :: NominalDiffTime -> NominalDiffTime Source #

toEnum :: Int -> NominalDiffTime Source #

fromEnum :: NominalDiffTime -> Int Source #

enumFrom :: NominalDiffTime -> [NominalDiffTime] Source #

enumFromThen :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

enumFromTo :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

enumFromThenTo :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

Eq NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods (==) :: NominalDiffTime -> NominalDiffTime -> Bool Source # (/=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #
Fractional NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods (/) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source # recip :: NominalDiffTime -> NominalDiffTime Source # fromRational :: Rational -> NominalDiffTime Source #
Data NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime Source #

toConstr :: NominalDiffTime -> Constr Source #

dataTypeOf :: NominalDiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

Num NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Time

Methods

(+) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

(-) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

(*) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

negate :: NominalDiffTime -> NominalDiffTime Source #

abs :: NominalDiffTime -> NominalDiffTime Source #

signum :: NominalDiffTime -> NominalDiffTime Source #

fromInteger :: Integer -> NominalDiffTime Source #

Ord NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

compare :: NominalDiffTime -> NominalDiffTime -> Ordering Source #

(<) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(<=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

max :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

min :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

Read NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods readsPrec :: Int -> ReadS NominalDiffTime Source # readList :: ReadS [NominalDiffTime] Source # readPrec :: ReadPrec NominalDiffTime Source # readListPrec :: ReadPrec [NominalDiffTime] Source #
Real NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods toRational :: NominalDiffTime -> Rational Source #
RealFrac NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Time Methods properFraction :: Integral b => NominalDiffTime -> (b, NominalDiffTime) Source # truncate :: Integral b => NominalDiffTime -> b Source # round :: Integral b => NominalDiffTime -> b Source # ceiling :: Integral b => NominalDiffTime -> b Source # floor :: Integral b => NominalDiffTime -> b Source #
Show NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods showsPrec :: Int -> NominalDiffTime -> ShowS Source # show :: NominalDiffTime -> String Source # showList :: [NominalDiffTime] -> ShowS Source #
Ix NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

range :: (NominalDiffTime, NominalDiffTime) -> [NominalDiffTime] Source #

index :: (NominalDiffTime, NominalDiffTime) -> NominalDiffTime -> Int Source #

unsafeIndex :: (NominalDiffTime, NominalDiffTime) -> NominalDiffTime -> Int

inRange :: (NominalDiffTime, NominalDiffTime) -> NominalDiffTime -> Bool Source #

rangeSize :: (NominalDiffTime, NominalDiffTime) -> Int Source #

unsafeRangeSize :: (NominalDiffTime, NominalDiffTime) -> Int

Generic NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Rep NominalDiffTime :: Type -> Type Source # Methods from :: NominalDiffTime -> Rep NominalDiffTime x Source # to :: Rep NominalDiffTime x -> NominalDiffTime Source #
Arbitrary NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods arbitrary :: Gen NominalDiffTime Source # shrink :: NominalDiffTime -> [NominalDiffTime] Source #
CoArbitrary NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods coarbitrary :: NominalDiffTime -> Gen b -> Gen b Source #
NFData NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods rnf :: NominalDiffTime -> () Source #
Random NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

randomR :: RandomGen g => (NominalDiffTime, NominalDiffTime) -> g -> (NominalDiffTime, g) Source #

random :: RandomGen g => g -> (NominalDiffTime, g) Source #

randomRs :: RandomGen g => (NominalDiffTime, NominalDiffTime) -> g -> [NominalDiffTime] Source #

randoms :: RandomGen g => g -> [NominalDiffTime] Source #

randomRIO :: (NominalDiffTime, NominalDiffTime) -> IO NominalDiffTime Source #

randomIO :: IO NominalDiffTime Source #

Unbox NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal
HasBasis NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Basis NominalDiffTime :: Type Source # Methods basisValue :: Basis NominalDiffTime -> NominalDiffTime Source # decompose :: NominalDiffTime -> [(Basis NominalDiffTime, Scalar NominalDiffTime)] Source # decompose' :: NominalDiffTime -> Basis NominalDiffTime -> Scalar NominalDiffTime Source #
VectorSpace NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Associated Types type Scalar NominalDiffTime :: Type Source # Methods (*^) :: Scalar NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #
AdditiveGroup NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods zeroV :: NominalDiffTime Source # (^+^) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source # negateV :: NominalDiffTime -> NominalDiffTime Source # (^-^) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #
TimeDiff NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods microseconds :: Iso' NominalDiffTime Int64 Source #
Vector Vector NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) NominalDiffTime -> m (Vector NominalDiffTime) Source #

basicUnsafeThaw :: PrimMonad m => Vector NominalDiffTime -> m (Mutable Vector (PrimState m) NominalDiffTime) Source #

basicLength :: Vector NominalDiffTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector NominalDiffTime -> Vector NominalDiffTime Source #

basicUnsafeIndexM :: Monad m => Vector NominalDiffTime -> Int -> m NominalDiffTime Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) NominalDiffTime -> Vector NominalDiffTime -> m () Source #

elemseq :: Vector NominalDiffTime -> NominalDiffTime -> b -> b Source #

MVector MVector NominalDiffTime Source # |

Instance details

Defined in Data.Thyme.Clock.Internal

Methods

basicLength :: MVector s NominalDiffTime -> Int Source #

basicUnsafeSlice :: Int -> Int -> MVector s NominalDiffTime -> MVector s NominalDiffTime Source #

basicOverlaps :: MVector s NominalDiffTime -> MVector s NominalDiffTime -> Bool Source #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) NominalDiffTime) Source #

basicInitialize :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> m () Source #

basicUnsafeReplicate :: PrimMonad m => Int -> NominalDiffTime -> m (MVector (PrimState m) NominalDiffTime) Source #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> Int -> m NominalDiffTime Source #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> Int -> NominalDiffTime -> m () Source #

basicClear :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> m () Source #

basicSet :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> NominalDiffTime -> m () Source #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> MVector (PrimState m) NominalDiffTime -> m () Source #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> MVector (PrimState m) NominalDiffTime -> m () Source #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) NominalDiffTime -> Int -> m (MVector (PrimState m) NominalDiffTime) Source #

Thyme NominalDiffTime NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Time.Core Methods thyme :: Iso' NominalDiffTime0 NominalDiffTime Source #
type Rep NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Rep NominalDiffTime = D1 (MetaData "NominalDiffTime" "Data.Thyme.Clock.Internal" "thyme-0.3.5.5-Fg1pPOWWkee1p55oP1P4W4" True) (C1 (MetaCons "NominalDiffTime" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Micro)))
newtype Vector NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype Vector NominalDiffTime = V_NominalDiffTime (Vector Micro)
type Basis NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Basis NominalDiffTime = ()
type Scalar NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal type Scalar NominalDiffTime = Rational
newtype MVector s NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal newtype MVector s NominalDiffTime = MV_NominalDiffTime (MVector s Micro)

getCurrentTime :: IO UTCTime Source #

Get the current UTC time from the system clock.

# Time interval conversion

class (HasBasis t, Basis t ~ (), Scalar t ~ Rational) => TimeDiff t where Source #

Time intervals, encompassing both `DiffTime` and `NominalDiffTime`.

`Issues`
  Still affected by http://hackage.haskell.org/trac/ghc/ticket/7611?

Methods

microseconds :: Iso' t Int64 Source #

Escape hatch; avoid.

Instances

TimeDiff DiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods microseconds :: Iso' DiffTime Int64 Source #
TimeDiff NominalDiffTime Source # |
Instance details Defined in Data.Thyme.Clock.Internal Methods microseconds :: Iso' NominalDiffTime Int64 Source #

toSeconds :: (TimeDiff t, Fractional n) => t -> n Source #

Convert a time interval to some `Fractional` type.

fromSeconds :: (Real n, TimeDiff t) => n -> t Source #

Make a time interval from some `Real` type.

`Performance`
  Try to make sure `n` is one of `Float`, `Double`, `Int`, `Int64` or `Integer`, for which rewrite `RULES` have been provided.

toSeconds' :: TimeDiff t => t -> Rational Source #

Type-restricted `toSeconds` to avoid constraint-defaulting warnings.

fromSeconds' :: TimeDiff t => Rational -> t Source #

Type-restricted `fromSeconds` to avoid constraint-defaulting warnings.

# Lenses

_utctDay :: Lens' UTCTime Day Source #

`Lens'` for the `Day` component of an `UTCView`.

_utctDayTime :: Lens' UTCTime DiffTime Source #

`Lens'` for the time-of-day component of an `UTCView`.