nanotime 0.2.0 → 0.3.0
raw patch · 2 files changed
+5/−8 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Nanotime: timeDeltaToNanos :: TimeDelta -> Maybe Word64
+ Nanotime: timeDeltaToNanos :: TimeDelta -> (Sign, Word64)
Files
- nanotime.cabal +1/−1
- src/Nanotime.hs +4/−7
nanotime.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: nanotime-version: 0.2.0+version: 0.3.0 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
@@ -139,17 +139,14 @@ SignPos -> a SignNeg -> negate a -timeDeltaToNanos :: TimeDelta -> Maybe Word64-timeDeltaToNanos (TimeDelta s m) =- case s of- SignNeg -> Nothing- SignPos -> Just m+timeDeltaToNanos :: TimeDelta -> (Sign, Word64)+timeDeltaToNanos (TimeDelta s m) = (s, m) threadDelayDelta :: TimeDelta -> IO () threadDelayDelta (TimeDelta s m) = case s of- SignNeg -> pure ()- SignPos -> threadDelay (fromIntegral (div m 1000))+ SignPos | m > 0 -> threadDelay (fromIntegral (div m 1000))+ _ -> pure () class (Ord t) => TimeLike t where -- | `diffTime end start` computes `end - start`