summaryrefslogtreecommitdiff
path: root/src/Remote
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-12 05:25:15 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-12 05:25:15 +0400
commitee8c82ed5ba8be43d858fa28020cc249d21795f6 (patch)
tree34dc29c71b4d1ed7886f831305bdf8f3303f6dd0 /src/Remote
parentae555a1e49b7cbe606aac4f24a37200fd78ce90e (diff)
- Remove bencodable instance for a pair.
Diffstat (limited to 'src/Remote')
-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 #-}