From 30ed5ec2dd5a60bf64da055c25c8ad86915bb14a Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sun, 16 Feb 2014 02:50:51 +0400 Subject: Add Show and Eq instances for routing table --- src/Network/BitTorrent/DHT/Routing.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Network/BitTorrent/DHT/Routing.hs') diff --git a/src/Network/BitTorrent/DHT/Routing.hs b/src/Network/BitTorrent/DHT/Routing.hs index 8e09d95e..106aec31 100644 --- a/src/Network/BitTorrent/DHT/Routing.hs +++ b/src/Network/BitTorrent/DHT/Routing.hs @@ -309,7 +309,10 @@ data Table ip -- right biased tree branch | One (Bucket ip) (Table ip) - deriving Generic + deriving (Show, Generic) + +instance Eq ip => Eq (Table ip) where + (==) = (==) `on` Network.BitTorrent.DHT.Routing.toList instance Serialize NominalDiffTime where put = putWord32be . fromIntegral . fromEnum -- cgit v1.2.3