From b2b8874245a7169cb3982ac6c338eb8fa6ed36bc Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Mon, 24 Feb 2014 16:49:58 +0400 Subject: Add instance Eq for ConnectionPrefs --- src/Network/BitTorrent/Exchange/Wire.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Network/BitTorrent/Exchange/Wire.hs b/src/Network/BitTorrent/Exchange/Wire.hs index d1bed146..4ddade66 100644 --- a/src/Network/BitTorrent/Exchange/Wire.hs +++ b/src/Network/BitTorrent/Exchange/Wire.hs @@ -393,6 +393,10 @@ data FloodDetector = FloodDetector , floodPredicate :: Detector ConnectionStats } deriving Show +instance Eq FloodDetector where + a == b = floodFactor a == floodFactor b + && floodThreshold a == floodThreshold b + -- | Flood detector with very permissive options. instance Default FloodDetector where def = FloodDetector @@ -444,7 +448,7 @@ data Options = Options -- 'ExtendedMetadata' for more info. -- , maxInfoDictSize :: {-# UNPACK #-} !Int - } deriving Show + } deriving (Show, Eq) -- | Permissive default parameters, most likely you don't need to -- change them. @@ -736,7 +740,7 @@ data ConnectionPrefs = ConnectionPrefs , prefProtocol :: !ProtocolName , prefCaps :: !Caps , prefExtCaps :: !ExtendedCaps - } + } deriving (Show, Eq) instance Default ConnectionPrefs where def = ConnectionPrefs -- cgit v1.2.3