HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulestreamly-core-0.2.2Haskell2010

Streamly.Internal.Data.Time.Units

  • 7 types
  • 2 classes
  • 12 values

Time Unit Conversions

2 declarations
classclass TimeUnit a where
#

A type class for converting between time units using Integer as the intermediate and the widest representation with a nanosecond resolution. This system of units can represent arbitrarily large times but provides least efficient arithmetic operations due to Integer arithmetic.

NOTE: Converting to and from units may truncate the value depending on the original value and the size and resolution of the destination unit.

A type class for converting between units of time using TimeSpec as the intermediate representation. This system of units can represent up to ~292 billion years at nanosecond resolution with reasonably efficient arithmetic operations.

NOTE: Converting to and from units may truncate the value depending on the original value and the size and resolution of the destination unit.

Instances4TimeUnit
classclass TimeUnit64 a where
#

A type class for converting between units of time using Int64 as the intermediate representation with a nanosecond resolution. This system of units can represent up to ~292 years at nanosecond resolution with fast arithmetic operations.

NOTE: Converting to and from units may truncate the value depending on the original value and the size and resolution of the destination unit.

Instances3TimeUnit64

Time Units

5 declarations
datadata TimeSpec
#

Data type to represent practically large quantities of time efficiently. It can represent time up to ~292 billion years at nanosecond resolution.

Constructors

Instances7Eq, Num, Ord, Read, Show, Storable, …
  • Eq TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.TimeSpec
  • Num TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.TimeSpec
  • Ord TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.TimeSpec
  • Read TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.TimeSpec
  • Show TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.TimeSpec
  • Storable TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.TimeSpec
  • TimeUnit TimeSpecDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
newtypenewtype NanoSecond64
#

An Int64 time representation with a nanosecond resolution. It can represent time up to ~292 years.

Constructors

Instances13Bounded, Enum, Eq, Integral, Num, Ord, …
newtypenewtype MicroSecond64
#

An Int64 time representation with a microsecond resolution. It can represent time up to ~292,000 years.

Constructors

Instances13Bounded, Enum, Eq, Integral, Num, Ord, …
newtypenewtype MilliSecond64
#

An Int64 time representation with a millisecond resolution. It can represent time up to ~292 million years.

Constructors

Instances13Bounded, Enum, Eq, Integral, Num, Ord, …

Absolute times (using TimeSpec)

3 declarations
newtypenewtype AbsTime
#

Absolute times are relative to a predefined epoch in time. AbsTime represents times using TimeSpec which can represent times up to ~292 billion years at a nanosecond resolution.

Constructors

Instances3Eq, Ord, Show
  • Eq AbsTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Ord AbsTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Show AbsTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units

Relative times (using TimeSpec)

5 declarations
newtypenewtype RelTime
#
Instances5Eq, Num, Ord, Read, Show
  • Eq RelTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Num RelTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Ord RelTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Read RelTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Show RelTimeDefined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units

Relative times (using NanoSecond64)

6 declarations
newtypenewtype RelTime64
#

Relative times are relative to some arbitrary point of time. Unlike AbsTime they are not relative to a predefined epoch.

Instances9Bounded, Enum, Eq, Integral, Num, Ord, …
  • Bounded RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Enum RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Eq RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Integral RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Num RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Ord RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Read RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Real RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units
  • Show RelTime64Defined in streamly-core-0.2.2 · Streamly.Internal.Data.Time.Units