]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Bencode.hs
remove redundant module imports for ghc 7.10
[functorrent.git] / src / FuncTorrent / Bencode.hs
index 8b6ff5229909266a42e85bb4a47952f32afe7af8..631a87fc1a1d7f53f2a14832fbd6378d55171190 100644 (file)
@@ -12,10 +12,8 @@ module FuncTorrent.Bencode
 
 import Prelude hiding (length, concat)
 
-import Control.Applicative ((<*))
 import Data.ByteString (ByteString, length, concat)
 import Data.ByteString.Char8 (unpack, pack)
-import Data.Functor ((<$>))
 import Data.Map.Strict (Map, fromList, toList)
 import Text.ParserCombinators.Parsec
 import qualified Text.Parsec.ByteString as ParsecBS
@@ -38,9 +36,9 @@ instance Arbitrary BVal where
                                , Bstr <$> arbitrary]
                 bval n = oneof [ Bint <$> arbitrary
                                , Bstr <$> arbitrary
-                               , Blist <$> vectorOf n arbitrary
+                               , Blist <$> vectorOf n (bval (n `div` 4))
                                , do keys <- vectorOf n arbitrary
-                                    vals <- vectorOf n arbitrary
+                                    vals <- vectorOf n (bval (n `div` 4))
                                     return $ Bdict $ fromList $ zip keys vals ]
 
 -- getters