diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-09-30 05:33:12 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-09-30 05:33:12 +0400 |
commit | e7cf4c0f1dff0eaa24aa5f8dfc2762192899f672 (patch) | |
tree | 183a8e8982d29911b1a424be579f04fbbcd4a804 | |
parent | 527df206a40c72786f3aa956c093fc226c9fcc82 (diff) |
Fix warnings
-rw-r--r-- | bench/Main.hs | 7 | ||||
-rw-r--r-- | src/Data/BEncode.hs | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/bench/Main.hs b/bench/Main.hs index 0259b3c..f5bc98e 100644 --- a/bench/Main.hs +++ b/bench/Main.hs | |||
@@ -6,14 +6,12 @@ | |||
6 | {-# LANGUAGE BangPatterns #-} | 6 | {-# LANGUAGE BangPatterns #-} |
7 | module Main (main) where | 7 | module Main (main) where |
8 | 8 | ||
9 | import Control.Applicative | ||
10 | import Control.DeepSeq | 9 | import Control.DeepSeq |
11 | import Data.Attoparsec.ByteString as Atto | 10 | import Data.Attoparsec.ByteString as Atto |
12 | import Data.ByteString as BS | 11 | import Data.ByteString as BS |
13 | import qualified Data.ByteString.Lazy as BL | 12 | import qualified Data.ByteString.Lazy as BL |
14 | import Data.List as L | 13 | import Data.List as L |
15 | import Data.Maybe | 14 | import Data.Maybe |
16 | import Data.Monoid | ||
17 | import Data.Typeable | 15 | import Data.Typeable |
18 | import System.Environment | 16 | import System.Environment |
19 | 17 | ||
@@ -26,7 +24,6 @@ import Data.AttoBencode.Parser as B | |||
26 | import "bencoding" Data.BEncode as C | 24 | import "bencoding" Data.BEncode as C |
27 | import "bencoding" Data.BEncode.Internal as C | 25 | import "bencoding" Data.BEncode.Internal as C |
28 | import "bencoding" Data.BEncode.Types as C | 26 | import "bencoding" Data.BEncode.Types as C |
29 | import Debug.Trace | ||
30 | 27 | ||
31 | 28 | ||
32 | instance NFData A.BEncode where | 29 | instance NFData A.BEncode where |
@@ -183,13 +180,13 @@ main = do | |||
183 | , let Right !be = C.parse torrentFile | 180 | , let Right !be = C.parse torrentFile |
184 | id' x = let t = either error id (fromBEncode x) | 181 | id' x = let t = either error id (fromBEncode x) |
185 | in toBEncode (t :: Torrent) | 182 | in toBEncode (t :: Torrent) |
186 | !test = let Right t = C.decode torrentFile | 183 | !_ = let Right t = C.decode torrentFile |
187 | in if C.decode (BL.toStrict (C.encode t)) | 184 | in if C.decode (BL.toStrict (C.encode t)) |
188 | /= Right (t :: Torrent) | 185 | /= Right (t :: Torrent) |
189 | then error "invalid instance: BEncode Torrent" | 186 | then error "invalid instance: BEncode Torrent" |
190 | else True | 187 | else True |
191 | 188 | ||
192 | replFn n f = go n | 189 | replFn m f = go m |
193 | where go 0 = id | 190 | where go 0 = id |
194 | go n = f . go (pred n) | 191 | go n = f . go (pred n) |
195 | 192 | ||
diff --git a/src/Data/BEncode.hs b/src/Data/BEncode.hs index 1284a83..189aedc 100644 --- a/src/Data/BEncode.hs +++ b/src/Data/BEncode.hs | |||
@@ -87,6 +87,7 @@ module Data.BEncode | |||
87 | , Get | 87 | , Get |
88 | , fromDict | 88 | , fromDict |
89 | 89 | ||
90 | , next | ||
90 | , req | 91 | , req |
91 | , opt | 92 | , opt |
92 | , field | 93 | , field |
@@ -104,7 +105,6 @@ import Control.Monad.State | |||
104 | import Control.Monad.Error | 105 | import Control.Monad.Error |
105 | import Data.Int | 106 | import Data.Int |
106 | import Data.List as L | 107 | import Data.List as L |
107 | import Data.Maybe (mapMaybe) | ||
108 | import Data.Monoid | 108 | import Data.Monoid |
109 | import Data.Word (Word8, Word16, Word32, Word64, Word) | 109 | import Data.Word (Word8, Word16, Word32, Word64, Word) |
110 | import Data.ByteString (ByteString) | 110 | import Data.ByteString (ByteString) |