Skip to content

Commit 4306093

Browse files
committed
version documentation repairs
1 parent ddb2932 commit 4306093

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

Streaming/Pipes.hs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
{-| "Pipes.Group.Tutorial" is the correct introduction to the use of this module,
22
which is mostly just an optimized @Pipes.Group@, replacing @FreeT@ with @Stream@.
3+
The module also includes optimized functions for interoperation:
4+
5+
> fromStream :: Monad m => Stream (Of a) m r -> Producer' a m r
6+
> toStream :: Monad m => Producer a m r -> Stream (Of a) m r
37
.
4-
The only systematic difference is that this simple module omits lenses, which
8+
It is not a drop in replacement for @Pipes.Group@. The only systematic difference
9+
is that this simple module omits lenses. It is hoped that this will
510
may make elementary usage easier to grasp. The lenses exported the pipes packages
6-
come into their own with the simple @StateT@ parsing procedure pipes promotes.
7-
I hope to make a corresponding @Streaming.Pipes.Lens@ soon.
11+
only come into their own with the simple @StateT@ parsing procedure pipes promotes.
12+
We are not attempting here to replicate this advanced procedure, but only to make
13+
elementary forms of breaking and splitting possible in the simplest possible way.
814
.
915
The @pipes-group@ tutorial
1016
is framed as a hunt for a genuinely streaming
11-
@threeGroups@. The formulation it opts for in the end would
17+
@threeGroups@, which would collect the first three groups of matching items while
18+
never holding more than the present item in memory.
19+
The formulation it opts for in the end would
1220
be expressed here thus:
1321
1422
> import Pipes
@@ -28,7 +36,11 @@
2836
'b'
2937
'c'
3038
'c'
31-
39+
40+
The new user might look at the examples of splitting, breaking and joining
41+
in @Streaming.Prelude@ keeping in mind that @Producer a m r@ is equivalent
42+
to @Stream (Of a) m r@.
43+
.
3244
For the rest, only part of the tutorial that would need revision is
3345
the bit at the end about writing explicit @FreeT@ programs. Here one does
3446
not proceed by pattern matching, but uses `inspect` in place of `runFreeT`
@@ -48,8 +60,6 @@
4860

4961
{-#LANGUAGE RankNTypes, BangPatterns #-}
5062

51-
52-
5363
module Streaming.Pipes (
5464
-- * @Streaming@ \/ @Pipes@ interoperation
5565
fromStream,
@@ -185,6 +195,7 @@ span predicate = loop where
185195
-}
186196
break :: Monad m => (a -> Bool) -> Producer a m r -> Producer a m (Producer a m r)
187197
break predicate = span (not . predicate)
198+
{-#INLINE break #-}
188199

189200
split :: (Eq a, Monad m) =>
190201
a -> Producer a m r -> Stream (Producer a m) m r

streaming-utils.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: streaming-utils
2-
version: 0.1.4.3
3-
synopsis: http, attoparsec, pipes and conduit utilities for the streaming libraries
2+
version: 0.1.4.4
3+
synopsis: http, attoparsec, utilities for the streaming libraries
44
description: Experimental http-client, aeson, attoparsec and pipes utilities for use with
55
the <http://hackage.haskell.org/package/streaming streaming> and
66
<http://hackage.haskell.org/package/streaming-bytestring streaming bytestring> libraries.

0 commit comments

Comments
 (0)