File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -442,9 +442,10 @@ map f = \ ary ->
442442 in run $ do
443443 mary <- new_ n
444444 go ary mary 0 n
445+ return mary
445446 where
446447 go ary mary i n
447- | i >= n = return mary
448+ | i >= n = return ()
448449 | otherwise = do
449450 x <- indexM ary i
450451 write mary i $ f x
@@ -458,9 +459,10 @@ map' f = \ ary ->
458459 in run $ do
459460 mary <- new_ n
460461 go ary mary 0 n
462+ return mary
461463 where
462464 go ary mary i n
463- | i >= n = return mary
465+ | i >= n = return ()
464466 | otherwise = do
465467 x <- indexM ary i
466468 write mary i $! f x
@@ -473,21 +475,23 @@ fromList n xs0 =
473475 run $ do
474476 mary <- new_ n
475477 go xs0 mary 0
478+ return mary
476479 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 )
480483
481484fromList' :: Int -> [a ] -> Array a
482485fromList' n xs0 =
483486 CHECK_EQ (" fromList'" , n, Prelude. length xs0)
484487 run $ do
485488 mary <- new_ n
486489 go xs0 mary 0
490+ return mary
487491 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 )
491495
492496-- | @since 0.2.17.0
493497instance TH. Lift a => TH. Lift (Array a ) where
You can’t perform that action at this time.
0 commit comments