From 5cfcd4996cbc258ba67b20d700d349190e20cb6d Mon Sep 17 00:00:00 2001 From: michaelt Date: Sat, 6 Feb 2016 23:10:05 -0500 Subject: repair remarks --- Pipes/Prelude/Text.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Pipes') diff --git a/Pipes/Prelude/Text.hs b/Pipes/Prelude/Text.hs index 29ade4d..814da0a 100644 --- a/Pipes/Prelude/Text.hs +++ b/Pipes/Prelude/Text.hs @@ -54,12 +54,13 @@ TWO THREE The point of view is very much that of @Pipes.Prelude@. It would still be the same even if - we did something more sophisticated, like run an ordinary attoparsec 'Text' parser on - each separate line with @Pipes.Prelude.map ()* , as is frequently reasonable. Here we admit - three values from standard input that pass the standard attoparsec @scientific@ number parser, + we did something more sophisticated, like run an ordinary attoparsec 'Text' parser on, + as is frequently reasonable. Here we run + the simple attoparsec @scientific@ number parser on lines of standard input, dropping bad parses with @P.concat@: ->>> P.toListM $ stdinLn >-> P.map (A.parseOnly A.scientific) >-> P.concat >-> P.take 3 +>>> import qualified Data.Attoparsec.Text as A +>>> P.toListM $ Text.stdinLn >-> P.map (A.parseOnly A.scientific) >-> P.concat >-> P.take 3 1 2 bad -- cgit v1.2.3