packages feed

hriemann 0.3.0.0 → 0.3.1.0

raw patch · 3 files changed

+6/−16 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hriemann.cabal view
@@ -1,5 +1,5 @@ name:                hriemann-version:             0.3.0.0+version:             0.3.1.0 synopsis:            Initial project template from stack description:         A Riemann Client for Haskell homepage:            https://github.com/shmish111/hriemann
src/Network/Monitoring/Riemann/Event.hs view
@@ -28,6 +28,7 @@ import           Data.Sequence import           Data.Time.Clock.POSIX import           Network.HostName+import           Network.Monitoring.Riemann.Json            () import qualified Network.Monitoring.Riemann.Proto.Attribute as Attribute import qualified Network.Monitoring.Riemann.Proto.Event     as E import           Text.ProtocolBuffers.Basic                 as Basic
src/Network/Monitoring/Riemann/Json.hs view
@@ -5,6 +5,7 @@ {-# OPTIONS_GHC  -fno-warn-orphans #-} module Network.Monitoring.Riemann.Json where +import           Control.Applicative                        ((<|>)) import           Data.Aeson                                 (FromJSON, ToJSON,                                                              Value (String),                                                              parseJSON, toJSON,@@ -44,21 +45,9 @@     mMetric_d <- v .:? "metric_d"     mMetric_f <- v .:? "metric_f"     mMetric <- v .:? "metric"-    let metric_sint64 = case mMetric_sint64 of-          Nothing -> do-            s <- mMetric-            toBoundedInteger s-          i -> i-    let metric_d = case mMetric_d of-          Nothing -> do-            s <- mMetric-            rightToJust $ toBoundedRealFloat s-          d -> d-    let metric_f = case mMetric_f of-          Nothing -> do-            s <- mMetric-            rightToJust $ toBoundedRealFloat s-          d -> d+    let metric_sint64 = mMetric_sint64 <|> (toBoundedInteger =<< mMetric)+        metric_d = mMetric_d <|> (rightToJust . toBoundedRealFloat =<< mMetric)+        metric_f = mMetric_f <|> (rightToJust . toBoundedRealFloat =<< mMetric)     pure Event { .. }  rightToJust :: Either l r -> Maybe r