summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-09-30 05:33:12 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-09-30 05:33:12 +0400
commite7cf4c0f1dff0eaa24aa5f8dfc2762192899f672 (patch)
tree183a8e8982d29911b1a424be579f04fbbcd4a804
parent527df206a40c72786f3aa956c093fc226c9fcc82 (diff)
Fix warnings
-rw-r--r--bench/Main.hs7
-rw-r--r--src/Data/BEncode.hs2
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 #-}
7module Main (main) where 7module Main (main) where
8 8
9import Control.Applicative
10import Control.DeepSeq 9import Control.DeepSeq
11import Data.Attoparsec.ByteString as Atto 10import Data.Attoparsec.ByteString as Atto
12import Data.ByteString as BS 11import Data.ByteString as BS
13import qualified Data.ByteString.Lazy as BL 12import qualified Data.ByteString.Lazy as BL
14import Data.List as L 13import Data.List as L
15import Data.Maybe 14import Data.Maybe
16import Data.Monoid
17import Data.Typeable 15import Data.Typeable
18import System.Environment 16import System.Environment
19 17
@@ -26,7 +24,6 @@ import Data.AttoBencode.Parser as B
26import "bencoding" Data.BEncode as C 24import "bencoding" Data.BEncode as C
27import "bencoding" Data.BEncode.Internal as C 25import "bencoding" Data.BEncode.Internal as C
28import "bencoding" Data.BEncode.Types as C 26import "bencoding" Data.BEncode.Types as C
29import Debug.Trace
30 27
31 28
32instance NFData A.BEncode where 29instance 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
104import Control.Monad.Error 105import Control.Monad.Error
105import Data.Int 106import Data.Int
106import Data.List as L 107import Data.List as L
107import Data.Maybe (mapMaybe)
108import Data.Monoid 108import Data.Monoid
109import Data.Word (Word8, Word16, Word32, Word64, Word) 109import Data.Word (Word8, Word16, Word32, Word64, Word)
110import Data.ByteString (ByteString) 110import Data.ByteString (ByteString)