summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/DHT/ContactInfo.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/DHT/ContactInfo.hs b/src/Network/BitTorrent/DHT/ContactInfo.hs
index dfc93ed7..ed38caf7 100644
--- a/src/Network/BitTorrent/DHT/ContactInfo.hs
+++ b/src/Network/BitTorrent/DHT/ContactInfo.hs
@@ -15,6 +15,7 @@ import Data.List as L
15import Data.Maybe 15import Data.Maybe
16import Data.HashMap.Strict as HM 16import Data.HashMap.Strict as HM
17import Data.Serialize 17import Data.Serialize
18import Data.Semigroup
18import Data.Wrapper.PSQ as PSQ 19import Data.Wrapper.PSQ as PSQ
19import Data.Time.Clock.POSIX 20import Data.Time.Clock.POSIX
20import Data.ByteString (ByteString) 21import Data.ByteString (ByteString)
@@ -190,6 +191,11 @@ instance Default (PeerStore) where
190 def = PeerStore HM.empty 191 def = PeerStore HM.empty
191 {-# INLINE def #-} 192 {-# INLINE def #-}
192 193
194instance Semigroup PeerStore where
195 PeerStore a <> PeerStore b =
196 PeerStore (HM.unionWith swarmInsert a b)
197 {-# INLINE (<>) #-}
198
193-- | Monoid under union operation. 199-- | Monoid under union operation.
194instance Monoid PeerStore where 200instance Monoid PeerStore where
195 mempty = def 201 mempty = def