diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2016-02-06 23:10:05 -0500 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2016-02-06 23:10:05 -0500 |
commit | 5cfcd4996cbc258ba67b20d700d349190e20cb6d (patch) | |
tree | cbc62673163c605ebaddb2673f372c5cf4b2d853 | |
parent | cca039badec3240c72a6b773802f3a17aceda001 (diff) | |
download | text-pipes-5cfcd4996cbc258ba67b20d700d349190e20cb6d.tar.gz text-pipes-5cfcd4996cbc258ba67b20d700d349190e20cb6d.tar.zst text-pipes-5cfcd4996cbc258ba67b20d700d349190e20cb6d.zip |
repair remarks
-rw-r--r-- | Pipes/Prelude/Text.hs | 9 |
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 | |||
54 | THREE | 54 | THREE |
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 | ||
63 | 1<Enter> | 64 | 1<Enter> |
64 | 2<Enter> | 65 | 2<Enter> |
65 | bad<Enter> | 66 | bad<Enter> |