File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ newtype Sqrt a = Sqrt { unSqrt :: a }
8080
8181instance Arbitrary a => Arbitrary (Sqrt a ) where
8282 arbitrary = fmap Sqrt $ sized $ \ n -> resize (smallish n) arbitrary
83- where
84- smallish = round . (sqrt :: Double -> Double ) . fromIntegral . abs
83+ where
84+ smallish = round . (sqrt :: Double -> Double ) . fromIntegral . abs
8585 shrink = map Sqrt . shrink . unSqrt
8686
8787instance Arbitrary T. Text where
@@ -96,9 +96,11 @@ newtype BigInt = Big Integer
9696 deriving (Eq , Show )
9797
9898instance Arbitrary BigInt where
99- arbitrary = choose (1 :: Int ,200 ) >>= \ e -> Big <$> choose (10 ^ (e- 1 ),10 ^ e)
99+ arbitrary = do
100+ e <- choose (1 :: Int ,200 )
101+ Big <$> choose (10 ^ (e- 1 ),10 ^ e)
100102 shrink (Big a) = [Big (a `div` 2 ^ (l- e)) | e <- shrink l]
101- where l = truncate (log (fromIntegral a) / log 2 :: Double ) :: Integer
103+ where l = truncate (logBase 2 (fromIntegral a) :: Double ) :: Integer
102104
103105newtype NotEmpty a = NotEmpty { notEmpty :: a }
104106 deriving (Eq , Ord , Show )
You can’t perform that action at this time.
0 commit comments