diff options
author | joe <joe@jerkface.net> | 2017-01-16 23:04:35 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-01-17 07:36:38 -0500 |
commit | 9c551511ae5a0d6cf7fc77daf6bd6b16b8eb8977 (patch) | |
tree | cc2d88abd7c1c5c5463dc305c5b09e7ae149c2ea /src/Data | |
parent | 5a69a35f99adfa2905e280aafe68c358afd3067f (diff) |
Clean up all warnings (ghc 8.0.1) in DHT component.
Diffstat (limited to 'src/Data')
-rw-r--r-- | src/Data/Torrent.hs | 13 |
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 | |||
166 | import Data.Char | 165 | import Data.Char |
167 | import Data.Convertible | 166 | import Data.Convertible |
168 | import Data.Default | 167 | import Data.Default |
169 | import Data.Foldable as F | ||
170 | import Data.Hashable as Hashable | 168 | import Data.Hashable as Hashable |
171 | import Data.Int | 169 | import Data.Int |
172 | import Data.List as L | 170 | import Data.List as L |
@@ -666,15 +664,6 @@ instance NFData PieceInfo where | |||
666 | instance Default PieceInfo where | 664 | instance Default PieceInfo where |
667 | def = PieceInfo 1 def | 665 | def = PieceInfo 1 def |
668 | 666 | ||
669 | class Lint a where | ||
670 | lint :: a -> Either String a | ||
671 | |||
672 | instance 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 | ||
679 | putPieceInfo :: Data.Torrent.Put PieceInfo | 668 | putPieceInfo :: Data.Torrent.Put PieceInfo |
680 | putPieceInfo PieceInfo {..} cont = | 669 | putPieceInfo 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 |
901 | instance BEncode String where | 890 | instance {-# 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 | ||