diff options
Diffstat (limited to 'bench/Main.hs')
-rw-r--r-- | bench/Main.hs | 7 |
1 files changed, 2 insertions, 5 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 | ||