It won't be a problem here, but it looks like the standard solution
mentioned by Gabriel there is subtly quadratic for the reasons that 
ndmitchell
brings up here, a little 
obscurely https://github.com/snoyberg/conduit/pull/209
(the lines function in question is similar to your mkLines)

If that's right, then to avoid this one needs to do like ndmitchell and 
emulate

http://hackage.haskell.org/package/bytestring-0.10.6.0/docs/src/Data.ByteString.Internal.html#line-500

a simple way around this would be to do something like

   L.purely PG.folds (fmap mconcat L.list) ::  PB.FreeT (Producer 
ByteString m) m r -> Producer ByteString m r

The left fold collecting a list is a little strange; there are other ways 
of going about it, e.g.
mapping each bytestring chunk to a builder, using L.mconcat, etc.

Note that ByteString implements mconcat specially, not as `foldr mappend 
mempty` but with the
`concat` I linked above. Maybe `Control.Foldl.ByteString` should have its 
own concatenating 
`Fold ByteString ByteString`  This might pass through some strict list type 
to collect
the fragments before building the bytestring, though probably there is no 
problem with 
the solution mentioned above.


-- 
You received this message because you are subscribed to the Google Groups 
"Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haskell-pipes+unsubscr...@googlegroups.com.
To post to this group, send email to haskell-pipes@googlegroups.com.

Reply via email to