time-units-types-0.2.0.1: Type-level representations of time durations.
Safe HaskellNone
LanguageHaskell2010

Data.Time.TypeLevel

Description

Exports types which can be used to describe time periods at the type-level. Use the durationVal function to reify them as the corresponding value-level descriptions from Data.Time.Units or the durationMicroseconds function to reify them as microseconds straight away.

Synopsis

Documentation

class KnownDuration k where Source #

A class of types which can be reified as value-level descriptions of time periods.

Associated Types

type DurationUnit k :: Type Source #

The type representing value-level descriptions of the time period corresponding to k.

Methods

durationVal :: DurationUnit k Source #

durationVal reifies the duration as the corresponding value-level type. Intended to be used with TypeApplications.

>>> durationVal @('Second 10)
10s :: Data.Time.Units.Second

Instances

Instances details
KnownNat n => KnownDuration ('Attosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Attosecond n) Source #

KnownNat n => KnownDuration ('Femtosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Femtosecond n) Source #

KnownNat n => KnownDuration ('Picosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Picosecond n) Source #

KnownNat n => KnownDuration ('Nanosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Nanosecond n) Source #

KnownNat n => KnownDuration ('Microsecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Microsecond n) Source #

KnownNat n => KnownDuration ('Millisecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Millisecond n) Source #

KnownNat n => KnownDuration ('Second n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Second n) Source #

KnownNat n => KnownDuration ('Minute n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Minute n) Source #

KnownNat n => KnownDuration ('Hour n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Hour n) Source #

KnownNat n => KnownDuration ('Day n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Day n) Source #

KnownNat n => KnownDuration ('Week n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Week n) Source #

KnownNat n => KnownDuration ('Fortnight n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Fortnight n) Source #

durationMicroseconds :: forall d. (KnownDuration d, TimeUnit (DurationUnit d)) => Integer Source #

durationMicroseconds is a convenience function which reifies a type-level duration as microseconds on the value level. Intended to be used with TypeApplications.

>>> durationMicroseconds @('Second 10)
10000000 :: Integer

data TimePeriod where Source #

Constructors

Attosecond :: Nat -> TimePeriod

Represents n-many attoseconds.

Femtosecond :: Nat -> TimePeriod

Represents n-many femtoseconds.

Picosecond :: Nat -> TimePeriod

Represents n-many picoseconds.

Nanosecond :: Nat -> TimePeriod

Represents n-many nanoseconds.

Microsecond :: Nat -> TimePeriod

Represents n-many microseconds.

Millisecond :: Nat -> TimePeriod

Represents n-many milliseconds.

Second :: Nat -> TimePeriod

Represents n-many seconds.

Minute :: Nat -> TimePeriod

Represents n-many minutes.

Hour :: Nat -> TimePeriod

Represents n-many hours.

Day :: Nat -> TimePeriod

Represents n-many days.

Week :: Nat -> TimePeriod

Represents n-many weeks.

Fortnight :: Nat -> TimePeriod

Represents n-many fortnights.

Instances

Instances details
KnownNat n => KnownDuration ('Attosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Attosecond n) Source #

KnownNat n => KnownDuration ('Femtosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Femtosecond n) Source #

KnownNat n => KnownDuration ('Picosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Picosecond n) Source #

KnownNat n => KnownDuration ('Nanosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Nanosecond n) Source #

KnownNat n => KnownDuration ('Microsecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Microsecond n) Source #

KnownNat n => KnownDuration ('Millisecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Millisecond n) Source #

KnownNat n => KnownDuration ('Second n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Second n) Source #

KnownNat n => KnownDuration ('Minute n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Minute n) Source #

KnownNat n => KnownDuration ('Hour n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Hour n) Source #

KnownNat n => KnownDuration ('Day n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Day n) Source #

KnownNat n => KnownDuration ('Week n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Week n) Source #

KnownNat n => KnownDuration ('Fortnight n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit ('Fortnight n) Source #

type DurationUnit ('Attosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Femtosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Picosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Nanosecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Microsecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Millisecond n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Second n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Minute n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Hour n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Day n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Week n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit ('Fortnight n :: TimePeriod) Source # 
Instance details

Defined in Data.Time.TypeLevel