Sorry, could you please elaborate? I'm a bit slow.

How do I use Control.Foldl.Fold to convert `Pipes a b m r` into `Pipes 
(ZipList a) (ZipList b) m r` ?


On Tuesday, 23 August 2016 13:20:24 UTC+10, Gabriel Gonzalez wrote:
>
> I would do what you're already doing with `Control.Foldl.Fold`.  That's 
> the approach I usually recommend for this.
>
> On Aug 22, 2016, at 6:45 PM, Louis Pan <lo...@pan.me <javascript:>> wrote:
>
> One approach I can think of is the use Pipes.Concurrent to manually split 
> the ZipList and then combine then results. Is there a nicer way?
>
> On Tuesday, 23 August 2016 11:35:50 UTC+10, Louis Pan wrote:
>>
>> Say I have a `Pipes a b m r` called 'p'.
>>
>> How do I convert it to a `Pipes (ZipList a) (ZipList b) m r`?
>> That is, I want to apply the pipe 'p' and apply zip-wise to an input 
>> ziplist, without losing the state of each pipe in the ziplist.
>>
>> The reason I want this, is that I want to run multiple attoparsec parsers 
>> in parallel in one pass of a file.
>>
>> My approach for this is to use Control.Foldl  to combine the attoparsec 
>> parsers into a `Control.Foldl.Fold ByteString [PartialParseResult]`, then 
>> convert it (using Control.Foldl.purely Pipes.Prelude.scan) to a `Pipe 
>> ByteString [PartialParseResult]`
>>
>> My other requirement is that I want to look at intermediate parser output 
>> (eg. each line of a file as it's parsed), in order to summarise each line, 
>> in a stateful way as I'm keeping track of the current line number.
>>
>> My approach for this is to use Control.Foldl.Fold for the summary logic, 
>> and then convert it to a pipe. I am able to create a `Pipe 
>> PartialParseResult AnalysisResult m r` for this.
>>
>> However, how do I connect a `Pipe ByteString [PartialParseResult] m r` to 
>> a `Pipe PartialParseResult AnalysisResult m r`?
>>
>> Regards,
>>
>> Louis
>>
>>
> -- 
> 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-pipe...@googlegroups.com <javascript:>.
> To post to this group, send email to haskel...@googlegroups.com 
> <javascript:>.
>
>
>

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