time-units-types-0.1.0.0: 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 (Fortnight n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Fortnight n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Week n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Day n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Hour n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Minute n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Second n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Millisecond n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Microsecond n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Nanosecond n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Picosecond n) Source #

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Femtosecond n) Source #

KnownNat n => KnownDuration (Attosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Attosecond 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 Attosecond (n :: Nat) Source #

Represents n-many attoseconds.

Instances

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

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Attosecond n) Source #

type DurationUnit (Attosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Femtosecond (n :: Nat) Source #

Represents n-many femtoseconds.

Instances

Instances details
KnownNat n => KnownDuration (Femtosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Femtosecond n) Source #

type DurationUnit (Femtosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Picosecond (n :: Nat) Source #

Represents n-many picoseconds.

Instances

Instances details
KnownNat n => KnownDuration (Picosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Picosecond n) Source #

type DurationUnit (Picosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Nanosecond (n :: Nat) Source #

Represents n-many nanoseconds.

Instances

Instances details
KnownNat n => KnownDuration (Nanosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Nanosecond n) Source #

type DurationUnit (Nanosecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Microsecond (n :: Nat) Source #

Represents n-many microseconds.

Instances

Instances details
KnownNat n => KnownDuration (Microsecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Microsecond n) Source #

type DurationUnit (Microsecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Millisecond (n :: Nat) Source #

Represents n-many milliseconds.

Instances

Instances details
KnownNat n => KnownDuration (Millisecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Millisecond n) Source #

type DurationUnit (Millisecond n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Second (n :: Nat) Source #

Represents n-many seconds.

Instances

Instances details
KnownNat n => KnownDuration (Second n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Second n) Source #

type DurationUnit (Second n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Minute (n :: Nat) Source #

Represents n-many minutes.

Instances

Instances details
KnownNat n => KnownDuration (Minute n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Minute n) Source #

type DurationUnit (Minute n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

data Hour (n :: Nat) Source #

Represents n-many hours.

Instances

Instances details
KnownNat n => KnownDuration (Hour n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Hour n) Source #

type DurationUnit (Hour n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit (Hour n :: Type) = Hour

data Day (n :: Nat) Source #

Represents n-many days.

Instances

Instances details
KnownNat n => KnownDuration (Day n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Day n) Source #

type DurationUnit (Day n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit (Day n :: Type) = Day

data Week (n :: Nat) Source #

Represents n-many weeks.

Instances

Instances details
KnownNat n => KnownDuration (Week n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Week n) Source #

type DurationUnit (Week n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

type DurationUnit (Week n :: Type) = Week

data Fortnight (n :: Nat) Source #

Represents n-many fortnights.

Instances

Instances details
KnownNat n => KnownDuration (Fortnight n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel

Associated Types

type DurationUnit (Fortnight n) Source #

type DurationUnit (Fortnight n :: Type) Source # 
Instance details

Defined in Data.Time.TypeLevel