Commits

Bryan O'Sullivan  committed ea5b2d8

Fix build problems with hashable >= 1.2

  • Participants
  • Parent commits 496899b

Comments (0)

Files changed (3)

File lib/Network/HTTP/LoadTest/Analysis.hs

+{-# OPTIONS_GHC -fsimpl-tick-factor=150 #-}
 {-# LANGUAGE BangPatterns, RecordWildCards #-}
 
 module Network.HTTP.LoadTest.Analysis

File lib/Network/HTTP/LoadTest/Types.hs

-{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, RecordWildCards,
-    ScopedTypeVariables, ViewPatterns #-}
+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, OverloadedStrings,
+    RecordWildCards, ScopedTypeVariables, ViewPatterns #-}
 
 module Network.HTTP.LoadTest.Types
     (
 import Control.DeepSeq (NFData(rnf))
 import Control.Exception (Exception, IOException, SomeException, try)
 import Data.Aeson.Types (Value(..), FromJSON(..), ToJSON(..), (.:), (.=), object)
-import Data.Bits (xor)
 import Data.Conduit (ResourceT)
 import Data.Data (Data)
-import Data.Hashable (Hashable(hash))
+import Data.Hashable (Hashable)
 import Data.Typeable (Typeable)
 import Network.HTTP.Conduit (Request(..), parseUrl)
+import GHC.Generics (Generic)
 import System.IO.Unsafe
 import qualified Data.ByteString.Char8 as B
 import qualified Data.CaseInsensitive as CI
 import qualified Data.Text as T
 import qualified Data.Vector as V
 import qualified Data.Vector.Generic as G
-import Control.Monad.Trans.Resource (ResourceT)
 
 newtype Req = Req {
       fromReq :: Request (ResourceT IO)
       respCode :: {-# UNPACK #-} !Int
     , respContentLength :: {-# UNPACK #-} !Int
     } | Timeout
-    deriving (Eq, Ord, Read, Show, Typeable, Data)
+    deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
 
-instance Hashable Event where
-    hash Timeout = 0
-    hash HttpResponse{..} = respCode `xor` respContentLength
+instance Hashable Event
 
 instance ToJSON Event where
     toJSON HttpResponse{..} = toJSON (respCode, respContentLength)
                          , "elapsed" .= summElapsed
                          , "event" .= summEvent
                          ]
-                                  
+
 instance FromJSON Summary where
     parseJSON (Object v) = Summary <$>
                            v .: "start" <*>
 category:            Network
 build-type:          Simple
 cabal-version:       >=1.8
-extra-source-files:  
+extra-source-files:
     README.markdown
     servers/ping/ping-servers.cabal
     servers/ping/src/*.hs
     criterion >= 0.6.0.0,
     deepseq,
     filepath,
-    hashable >= 1.1.2.0,
+    hashable >= 1.2.0.2,
     hastache,
     http-conduit >= 1.6,
     http-types,