thyme-0.2.3.0: A faster time library

Safe HaskellNone

Data.Thyme.Clock

Contents

Description

Num, Real, Fractional and RealFrac instances for DiffTime and NominalDiffTime are only available by importing Data.Thyme.Time. In their stead, instances of AdditiveGroup, HasBasis and VectorSpace are given here. Addition and subtraction are performed with the ^+^ and ^-^ operators from AdditiveGroup, while *^ scales by a Rational. To find the ratio of two time differences, define:

 (^/^) :: (HasBasis v, Basis v ~ (), Scalar v ~ s, Fractional s) => v -> v -> s
 (^/^) = (/) 'on' flip decompose' ()

Finally, write n *^ basisValue () where literals are expected.

UniversalTime and UTCTime are instances of AffineSpace, with Diff UniversalTimeDiffTime, and Diff UTCTimeNominalDiffTime.

Synopsis

Universal Time

Absolute intervals

UTC

Lenses