summaryrefslogtreecommitdiff
path: root/bench/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bench/Main.hs')
-rw-r--r--bench/Main.hs7
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 #-}
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