aboutsummaryrefslogtreecommitdiff
path: root/test/Gen.hs
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-16 09:51:51 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-16 09:55:27 +0100
commitf2cec69969a68e8feed3dceacef5186b1debdda5 (patch)
tree5dd2f491018c9c770faeaa8a7d21a26fc6f8d4fd /test/Gen.hs
parent16e03fbb6d99bf97c8f73980f70de88e5e638306 (diff)
Make ShR a newtype over ShX
Diffstat (limited to 'test/Gen.hs')
-rw-r--r--test/Gen.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/Gen.hs b/test/Gen.hs
index 952e8db..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)