Skip to content

Commit 009fba2

Browse files
committed
scanl1 and scanr1: Does not fuse (branches on null t)
1 parent bf9464e commit 009fba2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Data/Text.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,7 @@ scanl f z t = unstream (S.scanl g z (stream t))
10331033
{-# INLINE scanl #-}
10341034

10351035
-- | /O(n)/ 'scanl1' is a variant of 'scanl' that has no starting
1036-
-- value argument. Subject to fusion. Performs replacement on
1037-
-- invalid scalar values.
1036+
-- value argument. Performs replacement on invalid scalar values.
10381037
--
10391038
-- > scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
10401039
scanl1 :: (Char -> Char -> Char) -> Text -> Text
@@ -1052,8 +1051,7 @@ scanr f z = S.reverse . S.reverseScanr g z . reverseStream
10521051
{-# INLINE scanr #-}
10531052

10541053
-- | /O(n)/ 'scanr1' is a variant of 'scanr' that has no starting
1055-
-- value argument. Subject to fusion. Performs replacement on
1056-
-- invalid scalar values.
1054+
-- value argument. Performs replacement on invalid scalar values.
10571055
scanr1 :: (Char -> Char -> Char) -> Text -> Text
10581056
scanr1 f t | null t = empty
10591057
| otherwise = scanr f (last t) (init t)

0 commit comments

Comments
 (0)