Fix benchmark error in Data.Array.Stream (#2230)

This commit is contained in:
Ranjeet Ranjan 2023-01-15 10:21:14 +05:30 committed by GitHub
parent e23fed4ba1
commit 944dbbac6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,10 +284,14 @@ main = do
where
alloc value = do
small <- Stream.toList $ Stream.arraysOf 100 $ sourceUnfoldrM value 0
big <- Stream.toList $ Stream.arraysOf value $ sourceUnfoldrM value 0
return (small, big)
alloc value =
if value <= 0
then return (undefined, undefined)
else
do
small <- Stream.toList $ Stream.arraysOf 100 $ sourceUnfoldrM value 0
big <- Stream.toList $ Stream.arraysOf value $ sourceUnfoldrM value 0
return (small, big)
allBenchmarks env arrays value =
let (arraysSmall, arraysBig) = arrays