duration-0.2.0.0: A tiny compile-time time utility library inspired by zeit/ms
Copyright(c) Ryota Kameoka 2018
LicenseBSD-3
Maintainerkameoka.ryota@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Time.Clock.Duration.Types

Description

This module exports internally used type classes and data types. You can extend this package's functionality by utilizing them.

Synopsis

Type classes

class AbsoluteDuration a where Source #

The AbsoluteDuration class provides how to convert the given Time into a specific unit of time. An instance should represent a quantity with the dimension of T.

42 seconds in DiffTime (seconds):

>>> [t| 42s |] :: DiffTime
42s

42 seconds in CUSeconds (microseconds):

>>> [t| 42s |] :: CUSeconds
42000000

Instances

Instances details
AbsoluteDuration CUSeconds Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

AbsoluteDuration CSUSeconds Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

AbsoluteDuration NominalDiffTime Source # 
Instance details

Defined in Data.Time.Clock.Duration.Types

AbsoluteDuration DiffTime Source # 
Instance details

Defined in Data.Time.Clock.Duration.Types

class RelativeDuration a where Source #

The RelativeDuration class represents how to calculate how long the given Time is when measured in a specific unit of time. An instance should represent a quantity with the dimension of 1.

42 minutes in seconds:

>>> [s| 42m |] :: Int
2520

3 seconds in microseconds:

>>> [µs| 3s |] :: Int
3000000

Instances

Instances details
RelativeDuration Double Source # 
Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Float Source # 
Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Int Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Int8 Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Int16 Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Int32 Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Int64 Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

RelativeDuration Integer Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

Integral a => RelativeDuration (Ratio a) Source # 
Instance details

Defined in Data.Time.Clock.Duration.Types

HasResolution a => RelativeDuration (Fixed a) Source #

Caution: the fractional part will be rounded.

Instance details

Defined in Data.Time.Clock.Duration.Types

Data types

data Time Source #

The parsing result of a string inside a quasiquoter.

Constructors

Picosec Rational 
Nanosec Rational 
Microsec Rational 
Millisec Rational

Denoted by ms, msec, msecs, millisecond, or milliseconds

Second Rational

Denoted by s, sec, secs, second, or seconds

Minute Rational

Denoted by m, min, mins, minute, or minutes

Hour Rational

Denoted by h, hr, hrs, hour, or hours

Day Rational

Denoted by d, day, or days

Week Rational

Denoted by w, week, or weeks

Year Rational

Denoted by y, yr, yrs, year, or years

Instances

Instances details
Lift Time Source # 
Instance details

Defined in Data.Time.Clock.Duration.Types

Methods

lift :: Time -> Q Exp #

liftTyped :: Time -> Q (TExp Time) #