aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2016-02-06 23:10:05 -0500
committermichaelt <what_is_it_to_do_anything@yahoo.com>2016-02-06 23:10:05 -0500
commit5cfcd4996cbc258ba67b20d700d349190e20cb6d (patch)
treecbc62673163c605ebaddb2673f372c5cf4b2d853
parentcca039badec3240c72a6b773802f3a17aceda001 (diff)
downloadtext-pipes-5cfcd4996cbc258ba67b20d700d349190e20cb6d.tar.gz
text-pipes-5cfcd4996cbc258ba67b20d700d349190e20cb6d.tar.zst
text-pipes-5cfcd4996cbc258ba67b20d700d349190e20cb6d.zip
repair remarks
-rw-r--r--Pipes/Prelude/Text.hs9
1 files changed, 5 insertions, 4 deletions
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
54THREE 54THREE
55 55
56 The point of view is very much that of @Pipes.Prelude@. It would still be the same even if 56 The point of view is very much that of @Pipes.Prelude@. It would still be the same even if
57 we did something more sophisticated, like run an ordinary attoparsec 'Text' parser on 57 we did something more sophisticated, like run an ordinary attoparsec 'Text' parser on,
58 each separate line with @Pipes.Prelude.map ()* , as is frequently reasonable. Here we admit 58 as is frequently reasonable. Here we run
59 three values from standard input that pass the standard attoparsec @scientific@ number parser, 59 the simple attoparsec @scientific@ number parser on lines of standard input,
60 dropping bad parses with @P.concat@: 60 dropping bad parses with @P.concat@:
61 61
62>>> P.toListM $ stdinLn >-> P.map (A.parseOnly A.scientific) >-> P.concat >-> P.take 3 62>>> import qualified Data.Attoparsec.Text as A
63>>> P.toListM $ Text.stdinLn >-> P.map (A.parseOnly A.scientific) >-> P.concat >-> P.take 3
631<Enter> 641<Enter>
642<Enter> 652<Enter>
65bad<Enter> 66bad<Enter>