Copyright | (c) Ryota Kameoka 2018 |
---|---|
License | BSD-3 |
Maintainer | kameoka.ryota@gmail.com |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
This module exports internally used type classes and data types. You can extend this package's functionality by utilizing them.
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
toAbsoluteDuration :: Time -> a Source #
AbsoluteDuration CUSeconds Source # | Caution: the fractional part will be rounded. |
AbsoluteDuration CSUSeconds Source # | Caution: the fractional part will be rounded. |
AbsoluteDuration NominalDiffTime Source # | |
AbsoluteDuration DiffTime Source # | |
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
toRelativeDuration :: HasResolution r => Proxy r -> Time -> a Source #
RelativeDuration Double Source # | |
RelativeDuration Float Source # | |
RelativeDuration Int Source # | Caution: the fractional part will be rounded. |
RelativeDuration Int8 Source # | Caution: the fractional part will be rounded. |
RelativeDuration Int16 Source # | Caution: the fractional part will be rounded. |
RelativeDuration Int32 Source # | Caution: the fractional part will be rounded. |
RelativeDuration Int64 Source # | Caution: the fractional part will be rounded. |
RelativeDuration Integer Source # | Caution: the fractional part will be rounded. |
Integral a => RelativeDuration (Ratio a) Source # | |
HasResolution a => RelativeDuration (Fixed a) Source # | Caution: the fractional part will be rounded. |
Data types
The parsing result of a string inside a quasiquoter.
Picosec Rational | |
Nanosec Rational | |
Microsec Rational | |
Millisec Rational | Denoted by |
Second Rational | Denoted by |
Minute Rational | Denoted by |
Hour Rational | Denoted by |
Day Rational | Denoted by |
Week Rational | Denoted by |
Year Rational | Denoted by |