diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2013-11-18 10:32:44 -0500 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2013-11-18 10:32:44 -0500 |
commit | b4d21c025864357dab2b0df07091d953c6da98f3 (patch) | |
tree | e8d6f6803e23238568799dd9589c696100afe121 | |
parent | cf10d6f11b9a1912e234d449a4eef422e2dd1d66 (diff) | |
download | text-pipes-b4d21c025864357dab2b0df07091d953c6da98f3.tar.gz text-pipes-b4d21c025864357dab2b0df07091d953c6da98f3.tar.zst text-pipes-b4d21c025864357dab2b0df07091d953c6da98f3.zip |
Gabriel's emended 'lines'
-rw-r--r-- | Pipes/Text.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Pipes/Text.hs b/Pipes/Text.hs index cc08256..f2b4aac 100644 --- a/Pipes/Text.hs +++ b/Pipes/Text.hs | |||
@@ -781,12 +781,11 @@ lines p0 = PP.FreeT (go0 p0) | |||
781 | else return $ PP.Free $ go1 (yield txt >> p') | 781 | else return $ PP.Free $ go1 (yield txt >> p') |
782 | go1 p = do | 782 | go1 p = do |
783 | p' <- break ('\n' ==) p | 783 | p' <- break ('\n' ==) p |
784 | return $ PP.FreeT (go2 p') | 784 | return $ PP.FreeT $ do |
785 | go2 p = do | 785 | x <- nextChar p' |
786 | x <- nextChar p | 786 | case x of |
787 | return $ case x of | 787 | Left r -> return $ PP.Pure r |
788 | Left r -> PP.Pure r | 788 | Right (_, p'') -> go0 p'' |
789 | Right (_, p') -> PP.Free (go1 p') | ||
790 | {-# INLINABLE lines #-} | 789 | {-# INLINABLE lines #-} |
791 | 790 | ||
792 | 791 | ||