on master help sign in
Remove dead code, courtesy of QuickCheck 2.3
commitd90460220d82e8e142f41dcaaab14978bfb70479 authorBryan O'Sullivan <bos@lindenlab.com> dateMon 1 Nov 2010, 21:05 (16 years ago) parenta0f0523
2 files changed+2−35
tests/Properties.hs+2−5 tests/QuickCheckUtils.hs−30
tests/Properties.hs+2−5
@@ -93,9 +93,6 @@ data DecodeErr = DE String OnDecodeError
9393instance Show DecodeErr where
9494 show (DE d _) = "DE " ++ d
9595
96−instance CoArbitrary Word8 where
97− coarbitrary = coarbitraryIntegral
98−
9996instance Arbitrary DecodeErr where
10097 arbitrary = oneof [ return $ DE "lenient" lenientDecode
10198 , return $ DE "ignore" ignore
@@ -682,13 +679,13 @@ isFloaty c = c `elem` "+-.0123456789eE"
682679
683680t_read_rational p tol (n::Double) s =
684681 case p (T.pack (show n) `T.append` t) of
685− Left err -> False
682+ Left _err -> False
686683 Right (n',t') -> t == t' && abs (n-n') <= tol
687684 where t = T.dropWhile isFloaty s
688685
689686tl_read_rational p tol (n::Double) s =
690687 case p (TL.pack (show n) `TL.append` t) of
691− Left err -> False
688+ Left _err -> False
692689 Right (n',t') -> t == t' && abs (n-n') <= tol
693690 where t = TL.dropWhile isFloaty s
694691
tests/QuickCheckUtils.hs−30
@@ -5,8 +5,6 @@ module QuickCheckUtils where
55import Control.Arrow (first)
66import Data.Char (chr)
77import Data.Bits ((.&.))
8−import Data.Int (Int64)
9−import Data.Word (Word8, Word16, Word32)
108import Data.String (IsString, fromString)
119import qualified Data.Text as T
1210import Data.Text.Foreign (I16)
@@ -15,13 +13,6 @@ import System.Random (Random(..), RandomGen)
1513import Test.QuickCheck hiding ((.&.))
1614import qualified Data.ByteString as B
1715
18−instance Random Int64 where
19− randomR = integralRandomR
20− random = randomR (minBound,maxBound)
21−
22−instance Arbitrary Int64 where
23− arbitrary = choose (minBound,maxBound)
24−
2516instance Random I16 where
2617 randomR = integralRandomR
2718 random = randomR (minBound,maxBound)
@@ -29,30 +20,9 @@ instance Random I16 where
2920instance Arbitrary I16 where
3021 arbitrary = choose (minBound,maxBound)
3122
32−instance Random Word8 where
33− randomR = integralRandomR
34− random = randomR (minBound,maxBound)
35−
36−instance Arbitrary Word8 where
37− arbitrary = choose (minBound,maxBound)
38−
3923instance Arbitrary B.ByteString where
4024 arbitrary = B.pack `fmap` arbitrary
4125
42−instance Random Word16 where
43− randomR = integralRandomR
44− random = randomR (minBound,maxBound)
45−
46−instance Arbitrary Word16 where
47− arbitrary = choose (minBound,maxBound)
48−
49−instance Random Word32 where
50− randomR = integralRandomR
51− random = randomR (minBound,maxBound)
52−
53−instance Arbitrary Word32 where
54− arbitrary = choose (minBound,maxBound)
55−
5626genUnicode :: IsString a => Gen a
5727genUnicode = fmap fromString string where
5828 string = sized $ \n ->