diff options
Diffstat (limited to 'Pipes')
-rw-r--r-- | Pipes/Text.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Pipes/Text.hs b/Pipes/Text.hs index eb72be2..4b2d2b0 100644 --- a/Pipes/Text.hs +++ b/Pipes/Text.hs | |||
@@ -485,13 +485,15 @@ filter predicate = P.map (T.filter predicate) | |||
485 | scan | 485 | scan |
486 | :: (Monad m) | 486 | :: (Monad m) |
487 | => (Char -> Char -> Char) -> Char -> Pipe Text Text m r | 487 | => (Char -> Char -> Char) -> Char -> Pipe Text Text m r |
488 | scan step begin = go begin | 488 | scan step begin = do |
489 | yield (T.singleton begin) | ||
490 | go begin | ||
489 | where | 491 | where |
490 | go c = do | 492 | go c = do |
491 | txt <- await | 493 | txt <- await |
492 | let txt' = T.scanl step c txt | 494 | let txt' = T.scanl step c txt |
493 | c' = T.last txt' | 495 | c' = T.last txt' |
494 | yield txt' | 496 | yield (T.tail txt') |
495 | go c' | 497 | go c' |
496 | {-# INLINABLE scan #-} | 498 | {-# INLINABLE scan #-} |
497 | 499 | ||