HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehourglass-0.2.12Haskell2010

Data.Hourglass.Epoch

Epoch tracking

  • 4 types
  • 1 class
  • Packagehourglass-0.2.12
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceEpoch.hs

computer time tracking with various epoch

2 declarations
newtypenewtype ElapsedSince epoch
#

A number of seconds elapsed since an epoch.

Constructors

Instances9Eq, Data, Num, Ord, Read, Show, …
datadata ElapsedSinceP epoch
#

A number of seconds and nanoseconds elapsed since an epoch.

Constructors

Instances9Eq, Data, Num, Ord, Read, Show, …

Epoch

1 declaration
classclass Epoch epoch where
#

epoch related.

We use the well known Unix epoch as the reference timezone for doing conversion between epochs.

Each methods of this typeclass should not use the actual value, but only get the information needed from the type itself.

Methods

  • epochName :: epoch -> String

    The name of this epoch

  • epochDiffToUnix :: epoch -> Seconds

    number of seconds of difference with 1st January 1970.

    a negative number means that this epoch start before the unix epoch.

Instances2Epoch

standard and usual epochs

datadata UnixEpoch
#

Unix Epoch, starting 1st January 1970

Instances3Eq, Show, Epoch
  • Eq UnixEpochDefined in hourglass-0.2.12 · Data.Hourglass.Epoch
  • Show UnixEpochDefined in hourglass-0.2.12 · Data.Hourglass.Epoch
  • Epoch UnixEpochDefined in hourglass-0.2.12 · Data.Hourglass.Epoch