ngx-export-tools 0.4.7.0 → 0.4.8.0
raw patch · 3 files changed
+19/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ NgxExport.Tools: Unset :: TimeInterval
+ NgxExport.Tools: instance GHC.Classes.Ord NgxExport.Tools.TimeInterval
Files
- Changelog.md +5/−0
- NgxExport/Tools.hs +13/−2
- ngx-export-tools.cabal +1/−1
Changelog.md view
@@ -1,3 +1,8 @@+### 0.4.8.0++- Correct implementation of *Eq* and *Ord* instances for *TimeInterval*.+- A new value *Unset* equal to *Sec 0* added in *TimeInterval*.+ ### 0.4.7.0 - Derive *TimeInterval* from *Eq*.
NgxExport/Tools.hs view
@@ -68,6 +68,8 @@ import Data.IORef import Data.Maybe import Data.Aeson+import Data.Function (on)+import Data.Ord (comparing) import Control.Monad import Control.Arrow import Control.Exception@@ -145,9 +147,17 @@ | Sec Int -- ^ Seconds | HrMin Int Int -- ^ Hours and minutes | MinSec Int Int -- ^ Minutes and seconds- deriving (Generic, Lift, Read, Show, Eq)+ | Unset -- ^ Zero time interval, equal to @Sec 0@+ deriving (Generic, Lift, Read, Show)+ instance FromJSON TimeInterval +instance Eq TimeInterval where+ (==) = (==) `on` toSec++instance Ord TimeInterval where+ compare = comparing toSec+ -- | Converts a time interval into seconds. toSec :: TimeInterval -> Int toSec (Hr h) = 3600 * h@@ -155,8 +165,9 @@ toSec (Sec s) = s toSec (HrMin h m) = 3600 * h + 60 * m toSec (MinSec m s) = 60 * m + s+toSec Unset = 0 --- | Delays the current thread for the specified number of seconds.+-- | Delays the current thread by the specified number of seconds. threadDelaySec :: Int -> IO () threadDelaySec = threadDelay . (* 1e6)
ngx-export-tools.cabal view
@@ -1,5 +1,5 @@ name: ngx-export-tools-version: 0.4.7.0+version: 0.4.8.0 synopsis: Extra tools for Nginx haskell module description: Extra tools for <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>.