From a1047d32bac2674a94bcff643c9cc8defc224178 Mon Sep 17 00:00:00 2001 From: Phil Hazelden Date: Wed, 8 Jan 2025 12:31:15 +0000 Subject: [PATCH] Change distribution of `smallDenominators`. --- src/Test/QuickCheck/Arbitrary.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Test/QuickCheck/Arbitrary.hs b/src/Test/QuickCheck/Arbitrary.hs index 442eea80..7cb0d64b 100644 --- a/src/Test/QuickCheck/Arbitrary.hs +++ b/src/Test/QuickCheck/Arbitrary.hs @@ -722,8 +722,8 @@ instance Arbitrary Float where ] where smallDenominators = sized $ \n -> do - i <- chooseInt (0, n) - pure (fromRational (streamNth (min i 256) rationalUniverse)) + i <- chooseInt (0, min n 256) + pure (fromRational (streamNth i rationalUniverse)) uniform = sized $ \n -> do let n' = toInteger n @@ -748,8 +748,8 @@ instance Arbitrary Double where ] where smallDenominators = sized $ \n -> do - i <- chooseInt (0, n) - pure (fromRational (streamNth (min i 256) rationalUniverse)) + i <- chooseInt (0, min n 256) + pure (fromRational (streamNth i rationalUniverse)) uniform = sized $ \n -> do let n' = toInteger n