nanotime 0.3.1 → 0.3.2
raw patch · 2 files changed
+7/−4 lines, 2 files
Files
- nanotime.cabal +1/−1
- src/Nanotime.hs +6/−3
nanotime.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: nanotime-version: 0.3.1+version: 0.3.2 synopsis: a tiny time library description: Please see the README on GitHub at <https://github.com/ejconlon/nanotime#readme> homepage: https://github.com/ejconlon/nanotime#readme
src/Nanotime.hs view
@@ -177,7 +177,8 @@ target <$ threadDelayDelta td newtype PosixTime = PosixTime {unPosixTime :: Word64}- deriving stock (Eq, Show, Ord, Bounded)+ deriving stock (Show)+ deriving newtype (Eq, Ord, Bounded, Num) -- | Show 'PosixTime' as a UTC ISO-8601 String for debugging showPosixTime :: PosixTime -> String@@ -199,7 +200,8 @@ -- | Monotonic time in nanoseconds since some unspecified epoch (see 'getMonotonicTimeNs') newtype MonoTime = MonoTime {unMonoTime :: Word64}- deriving stock (Eq, Show, Ord, Bounded)+ deriving stock (Show)+ deriving newtype (Eq, Ord, Bounded, Num) monoTimeFromFracSecs :: (Real a, Show a) => a -> MonoTime monoTimeFromFracSecs d = MonoTime (round (1000000000 * toRational (assertingNonNegative d)))@@ -219,7 +221,8 @@ currentTime = fmap MonoTime getMonotonicTimeNSec newtype NtpTime = NtpTime {unNtpTime :: Word64}- deriving stock (Eq, Show, Ord, Bounded)+ deriving stock (Show)+ deriving newtype (Eq, Ord, Bounded, Num) -- private nanoWordToSplit :: Word64 -> (Word32, Word32)