Permalink
Browse files

Remove dead code, courtesy of QuickCheck 2.3

  • Loading branch information...
Bryan O'Sullivan
Bryan O'Sullivan committed Nov 2, 2010
1 parent a0f0523 commit d90460220d82e8e142f41dcaaab14978bfb70479
Showing with 2 additions and 35 deletions.
  1. +2 −5 tests/Properties.hs
  2. +0 −30 tests/QuickCheckUtils.hs
View
@@ -93,9 +93,6 @@ data DecodeErr = DE String OnDecodeError
instance Show DecodeErr where
show (DE d _) = "DE " ++ d
-instance CoArbitrary Word8 where
- coarbitrary = coarbitraryIntegral
-
instance Arbitrary DecodeErr where
arbitrary = oneof [ return $ DE "lenient" lenientDecode
, return $ DE "ignore" ignore
@@ -682,13 +679,13 @@ isFloaty c = c `elem` "+-.0123456789eE"
t_read_rational p tol (n::Double) s =
case p (T.pack (show n) `T.append` t) of
- Left err -> False
+ Left _err -> False
Right (n',t') -> t == t' && abs (n-n') <= tol
where t = T.dropWhile isFloaty s
tl_read_rational p tol (n::Double) s =
case p (TL.pack (show n) `TL.append` t) of
- Left err -> False
+ Left _err -> False
Right (n',t') -> t == t' && abs (n-n') <= tol
where t = TL.dropWhile isFloaty s
View
@@ -5,8 +5,6 @@ module QuickCheckUtils where
import Control.Arrow (first)
import Data.Char (chr)
import Data.Bits ((.&.))
-import Data.Int (Int64)
-import Data.Word (Word8, Word16, Word32)
import Data.String (IsString, fromString)
import qualified Data.Text as T
import Data.Text.Foreign (I16)
@@ -15,44 +13,16 @@ import System.Random (Random(..), RandomGen)
import Test.QuickCheck hiding ((.&.))
import qualified Data.ByteString as B
-instance Random Int64 where
- randomR = integralRandomR
- random = randomR (minBound,maxBound)
-
-instance Arbitrary Int64 where
- arbitrary = choose (minBound,maxBound)
-
instance Random I16 where
randomR = integralRandomR
random = randomR (minBound,maxBound)
instance Arbitrary I16 where
arbitrary = choose (minBound,maxBound)
-instance Random Word8 where
- randomR = integralRandomR
- random = randomR (minBound,maxBound)
-
-instance Arbitrary Word8 where
- arbitrary = choose (minBound,maxBound)
-
instance Arbitrary B.ByteString where
arbitrary = B.pack `fmap` arbitrary
-instance Random Word16 where
- randomR = integralRandomR
- random = randomR (minBound,maxBound)
-
-instance Arbitrary Word16 where
- arbitrary = choose (minBound,maxBound)
-
-instance Random Word32 where
- randomR = integralRandomR
- random = randomR (minBound,maxBound)
-
-instance Arbitrary Word32 where
- arbitrary = choose (minBound,maxBound)
-
genUnicode :: IsString a => Gen a
genUnicode = fmap fromString string where
string = sized $ \n ->

0 comments on commit d904602

Please sign in to comment.