File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1822,18 +1822,22 @@ scanr' f z = unstreamR . Bundle.scanl' (flip f) z . streamR
1822
1822
-- | /O(n)/ Right-to-left scan over a vector with its index
1823
1823
iscanr :: (Vector v a , Vector v b ) => (Int -> a -> b -> b ) -> b -> v a -> v b
1824
1824
{-# INLINE iscanr #-}
1825
- iscanr f z =
1825
+ iscanr f z v =
1826
1826
unstreamR
1827
- . inplace (S. scanl (flip $ uncurry f) z . S. indexed ) (+ 1 )
1827
+ . inplace (S. scanl (flip $ uncurry f) z . S. indexedR n ) (+ 1 )
1828
1828
. streamR
1829
+ $ v
1830
+ where n = length v
1829
1831
1830
1832
-- | /O(n)/ Right-to-left scan over a vector (strictly) with its index
1831
1833
iscanr' :: (Vector v a , Vector v b ) => (Int -> a -> b -> b ) -> b -> v a -> v b
1832
1834
{-# INLINE iscanr' #-}
1833
- iscanr' f z =
1835
+ iscanr' f z v =
1834
1836
unstreamR
1835
- . inplace (S. scanl' (flip $ uncurry f) z . S. indexed ) (+ 1 )
1837
+ . inplace (S. scanl' (flip $ uncurry f) z . S. indexedR n ) (+ 1 )
1836
1838
. streamR
1839
+ $ v
1840
+ where n = length v
1837
1841
1838
1842
-- | /O(n)/ Right-to-left scan over a non-empty vector
1839
1843
scanr1 :: Vector v a => (a -> a -> a ) -> v a -> v a
You can’t perform that action at this time.
0 commit comments