From ee8c82ed5ba8be43d858fa28020cc249d21795f6 Mon Sep 17 00:00:00 2001 From: Sam T Date: Sun, 12 May 2013 05:25:15 +0400 Subject: - Remove bencodable instance for a pair. --- src/Remote/KRPC/Protocol.hs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src') 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 Right query -> (either toBEncode toBEncode <$> action addr query) `catch` (return . toBEncode . serverError) Left decodeE -> return $ toBEncode (ProtocolError (BC.pack decodeE)) - - --- TODO to bencodable -instance (BEncodable a, BEncodable b) => BEncodable (a, b) where - {-# SPECIALIZE instance (BEncodable a, BEncodable b) => BEncodable (a, b) #-} - toBEncode (a, b) = BList [toBEncode a, toBEncode b] - {-# INLINE toBEncode #-} - - fromBEncode be = case fromBEncode be of - Right [a, b] -> (,) <$> fromBEncode a <*> fromBEncode b - Right _ -> decodingError "Unable to decode a pair." - Left e -> Left e - {-# INLINE fromBEncode #-} -- cgit v1.2.3