summaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-01-16 23:04:35 -0500
committerjoe <joe@jerkface.net>2017-01-17 07:36:38 -0500
commit9c551511ae5a0d6cf7fc77daf6bd6b16b8eb8977 (patch)
treecc2d88abd7c1c5c5463dc305c5b09e7ae149c2ea /src/Data
parent5a69a35f99adfa2905e280aafe68c358afd3067f (diff)
Clean up all warnings (ghc 8.0.1) in DHT component.
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/Torrent.hs13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs
index 6bec665e..c22ca189 100644
--- a/src/Data/Torrent.hs
+++ b/src/Data/Torrent.hs
@@ -19,7 +19,6 @@
19{-# LANGUAGE CPP #-} 19{-# LANGUAGE CPP #-}
20{-# LANGUAGE NamedFieldPuns #-} 20{-# LANGUAGE NamedFieldPuns #-}
21{-# LANGUAGE FlexibleInstances #-} 21{-# LANGUAGE FlexibleInstances #-}
22{-# LANGUAGE OverlappingInstances #-}
23{-# LANGUAGE MultiParamTypeClasses #-} 22{-# LANGUAGE MultiParamTypeClasses #-}
24{-# LANGUAGE BangPatterns #-} 23{-# LANGUAGE BangPatterns #-}
25{-# LANGUAGE GeneralizedNewtypeDeriving #-} 24{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -166,7 +165,6 @@ import Data.ByteString.Lazy as BL
166import Data.Char 165import Data.Char
167import Data.Convertible 166import Data.Convertible
168import Data.Default 167import Data.Default
169import Data.Foldable as F
170import Data.Hashable as Hashable 168import Data.Hashable as Hashable
171import Data.Int 169import Data.Int
172import Data.List as L 170import Data.List as L
@@ -666,15 +664,6 @@ instance NFData PieceInfo where
666instance Default PieceInfo where 664instance Default PieceInfo where
667 def = PieceInfo 1 def 665 def = PieceInfo 1 def
668 666
669class Lint a where
670 lint :: a -> Either String a
671
672instance Lint PieceInfo where
673 lint pinfo @ PieceInfo {..}
674 | BS.length (unHashList piPieceHashes) `rem` hashsize == 0
675 , piPieceLength >= 0 = return pinfo
676 | otherwise = Left undefined
677
678 667
679putPieceInfo :: Data.Torrent.Put PieceInfo 668putPieceInfo :: Data.Torrent.Put PieceInfo
680putPieceInfo PieceInfo {..} cont = 669putPieceInfo PieceInfo {..} cont =
@@ -898,7 +887,7 @@ instance BEncode POSIXTime where
898 fromBEncode _ = decodingError $ "POSIXTime" 887 fromBEncode _ = decodingError $ "POSIXTime"
899 888
900-- TODO to bencoding package 889-- TODO to bencoding package
901instance BEncode String where 890instance {-# OVERLAPPING #-} BEncode String where
902 toBEncode = toBEncode . T.pack 891 toBEncode = toBEncode . T.pack
903 fromBEncode v = T.unpack <$> fromBEncode v 892 fromBEncode v = T.unpack <$> fromBEncode v
904 893