Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions that operate on Nanoseconds
. All of these functions have
trivial implementations and are provided for convenience. This module
is intended to be imported qualified.
- add :: Nanoseconds -> Nanoseconds -> Nanoseconds
- scale :: Int64 -> Nanoseconds -> Nanoseconds
- negate :: Nanoseconds -> Nanoseconds
- fromSeconds :: Int64 -> Nanoseconds
- fromMinutes :: Int64 -> Nanoseconds
- fromHours :: Int64 -> Nanoseconds
- fromDays :: Int64 -> Nanoseconds
- fromWeeks :: Int64 -> Nanoseconds
Arithmetic
add :: Nanoseconds -> Nanoseconds -> Nanoseconds Source
scale :: Int64 -> Nanoseconds -> Nanoseconds Source
negate :: Nanoseconds -> Nanoseconds Source
From Duration
These functions are at times convenient, but on a fundamental level,
all of them except for fromSeconds
are incorrect. If we account for
leap seconds, we must acknowledge that not all minutes contain 60 seconds.
Some contain 61 seconds, and in the future some may contain 59 seconds.
fromSeconds :: Int64 -> Nanoseconds Source
fromMinutes :: Int64 -> Nanoseconds Source
fromHours :: Int64 -> Nanoseconds Source
fromDays :: Int64 -> Nanoseconds Source
fromWeeks :: Int64 -> Nanoseconds Source