File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -442,9 +442,10 @@ map f = \ ary ->
442
442
in run $ do
443
443
mary <- new_ n
444
444
go ary mary 0 n
445
+ return mary
445
446
where
446
447
go ary mary i n
447
- | i >= n = return mary
448
+ | i >= n = return ()
448
449
| otherwise = do
449
450
x <- indexM ary i
450
451
write mary i $ f x
@@ -458,9 +459,10 @@ map' f = \ ary ->
458
459
in run $ do
459
460
mary <- new_ n
460
461
go ary mary 0 n
462
+ return mary
461
463
where
462
464
go ary mary i n
463
- | i >= n = return mary
465
+ | i >= n = return ()
464
466
| otherwise = do
465
467
x <- indexM ary i
466
468
write mary i $! f x
@@ -473,21 +475,23 @@ fromList n xs0 =
473
475
run $ do
474
476
mary <- new_ n
475
477
go xs0 mary 0
478
+ return mary
476
479
where
477
- go [] ! mary ! _ = return mary
478
- go (x: xs) mary i = do write mary i x
479
- go xs mary (i+ 1 )
480
+ go [] ! _ ! _ = return ()
481
+ go (x: xs) mary i = do write mary i x
482
+ go xs mary (i+ 1 )
480
483
481
484
fromList' :: Int -> [a ] -> Array a
482
485
fromList' n xs0 =
483
486
CHECK_EQ (" fromList'" , n, Prelude. length xs0)
484
487
run $ do
485
488
mary <- new_ n
486
489
go xs0 mary 0
490
+ return mary
487
491
where
488
- go [] ! mary ! _ = return mary
489
- go (! x: xs) mary i = do write mary i x
490
- go xs mary (i+ 1 )
492
+ go [] ! _ ! _ = return ()
493
+ go (! x: xs) mary i = do write mary i x
494
+ go xs mary (i+ 1 )
491
495
492
496
-- | @since 0.2.17.0
493
497
instance TH. Lift a => TH. Lift (Array a ) where
You can’t perform that action at this time.
0 commit comments