aboutsummaryrefslogtreecommitdiff
path: root/test/Gen.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Gen.hs')
-rw-r--r--test/Gen.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/Gen.hs b/test/Gen.hs
index 4f5fe96..789a59c 100644
--- a/test/Gen.hs
+++ b/test/Gen.hs
@@ -11,7 +11,6 @@
module Gen where
import Data.ByteString qualified as BS
-import Data.Foldable (toList)
import Data.Type.Equality
import Data.Type.Ord
import Data.Vector.Storable qualified as VS
@@ -46,7 +45,7 @@ genLowBiased (lo, hi) = do
return (lo + x * x * x * (hi - lo))
shuffleShR :: IShR n -> Gen (IShR n)
-shuffleShR = \sh -> go (length sh) (toList sh) sh
+shuffleShR = \sh -> go (shrLength sh) (shrToList sh) sh
where
go :: Int -> [Int] -> IShR n -> Gen (IShR n)
go _ _ ZSR = return ZSR
@@ -78,7 +77,7 @@ genShRwithTarget targetMax sn = do
dims <- genDims m (if dim == 0 then 0 else tgt `div` dim)
return (dim :$: dims)
dims <- genDims sn targetSize
- let maxdim = maximum dims
+ let maxdim = maximum $ shrToList dims
cap = binarySearch (`div` 2) 1 maxdim (\cap' -> shrSize (min cap' <$> dims) <= targetSize)
shuffleShR (min cap <$> dims)
@@ -139,7 +138,7 @@ genStaticShX = \n k -> case n of
genStaticShX n' $ \ssh ->
k (item :!% ssh)
where
- genItem :: Monad m => (forall n. SMayNat () SNat n -> PropertyT m ()) -> PropertyT m ()
+ genItem :: Monad m => (forall n. SMayNat () n -> PropertyT m ()) -> PropertyT m ()
genItem k = do
b <- forAll Gen.bool
if b