summaryrefslogtreecommitdiff
path: root/src/Remote/KRPC/Protocol.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Remote/KRPC/Protocol.hs')
-rw-r--r--src/Remote/KRPC/Protocol.hs13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/Remote/KRPC/Protocol.hs b/src/Remote/KRPC/Protocol.hs
index c922c1d6..7351831b 100644
--- a/src/Remote/KRPC/Protocol.hs
+++ b/src/Remote/KRPC/Protocol.hs
@@ -266,16 +266,3 @@ remoteServer servport action = bracket (liftIO bind) (liftIO . sClose) loop
266 Right query -> (either toBEncode toBEncode <$> action addr query) 266 Right query -> (either toBEncode toBEncode <$> action addr query)
267 `catch` (return . toBEncode . serverError) 267 `catch` (return . toBEncode . serverError)
268 Left decodeE -> return $ toBEncode (ProtocolError (BC.pack decodeE)) 268 Left decodeE -> return $ toBEncode (ProtocolError (BC.pack decodeE))
269
270
271-- TODO to bencodable
272instance (BEncodable a, BEncodable b) => BEncodable (a, b) where
273 {-# SPECIALIZE instance (BEncodable a, BEncodable b) => BEncodable (a, b) #-}
274 toBEncode (a, b) = BList [toBEncode a, toBEncode b]
275 {-# INLINE toBEncode #-}
276
277 fromBEncode be = case fromBEncode be of
278 Right [a, b] -> (,) <$> fromBEncode a <*> fromBEncode b
279 Right _ -> decodingError "Unable to decode a pair."
280 Left e -> Left e
281 {-# INLINE fromBEncode #-}