From fbff2b6e4681b75b54a918baec9c49ba8f110d75 Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Fri, 1 Aug 2014 20:46:56 +0200 Subject: isLeft is in base-4.7.x, this is cleaner than CPP --- src/Network/BitTorrent/DHT/Query.hs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Network') diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index d4710ecf..f7657490 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs @@ -127,17 +127,13 @@ findNodeQ key NodeInfo {..} = do NodeFound closest <- FindNode (toNodeId key) <@> nodeAddr return $ Right closest -isLeft :: Either a b -> Bool -isLeft (Right _) = False -isLeft (Left _) = True - getPeersQ :: Address ip => InfoHash -> Iteration ip PeerAddr getPeersQ topic NodeInfo {..} = do GotPeers {..} <- GetPeers topic <@> nodeAddr let dist = distance (toNodeId topic) nodeId $(logInfoS) "getPeersQ" $ T.pack $ "distance: " <> render (pretty dist) <> " , result: " - <> if isLeft peers then "NODES" else "PEERS" + <> case peers of { Left _ -> "NODES"; Right _ -> "PEERS" } return peers announceQ :: Address ip => InfoHash -> PortNumber -> Iteration ip NodeAddr -- cgit v1.2.3 From e79cb26162711b9b491bc56f174235238c3779b7 Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Fri, 1 Aug 2014 22:01:10 +0200 Subject: Disambiguate Proxy reference --- src/Network/BitTorrent/Tracker/RPC/HTTP.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Network') diff --git a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs index 6e55eb04..de3fc5f5 100644 --- a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs +++ b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs @@ -37,7 +37,7 @@ import Data.ByteString.Lazy as BL import Data.Default import Data.List as L import Data.Monoid -import Data.Typeable +import Data.Typeable hiding (Proxy) import Network.URI import Network.HTTP.Conduit hiding (Manager, newManager, closeManager, withManager) -- cgit v1.2.3