I'm trying my hand at writing a Producer "transformer" similar to 
`Pipes.ByteString.lines` which will split a ByteString stream into lines 
ending in the string `"xy"`.

You can view my latest attempt at:

http://lpaste.net/165424

My functions corresponding to `line`, `_lines` and `lines` are `splitXY`, 
`_splitXY`, and  `splitXYs`.

It seems to work - try running `main1` and `main2`. The questions I have 
are:

1. Any issues with the code? (One problem I just spotted while writing this 
post is that if the input stream ends in `"xy"` an extra empty string is 
yielded at the end.)

2. Is there a library function which does the work of `loop1` -- i.e. 
traversing down a `Producer ... (Producer ...)` chain?

3. `splitXYs` was written to be analogous to `lines`, but GHC complains 
when I try type it the same way. ???

4. This was just an exercise in understanding how `lines` worked. What 
would be the recommended way to do this in the pipes ecosystem?

Thanks,
Erik

-- 
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