Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Iteratees
    primarykey
    data
    text
    <p>I am working with a particular database where, upon a successful query, you are able to access a group of chunks of the resulting data using a specific command:</p> <pre><code>getResultData :: IO (ResponseCode, ByteString) </code></pre> <p>Now getResultData will return a response code and some data where the response codes look like this:</p> <pre><code>response = GET_DATA_FAILED | OPERATION_SUCCEEDED | NO_MORE_DATA </code></pre> <p>The ByteString is one, some, or all of the chunks:</p> <p><a href="http://desmond.imageshack.us/Himg189/scaled.php?server=189&amp;filename=chunksjpeg.png&amp;res=medium" rel="nofollow noreferrer">Data http://desmond.imageshack.us/Himg189/scaled.php?server=189&amp;filename=chunksjpeg.png&amp;res=medium</a></p> <p>The story does not end here. There exists a stream of groups:</p> <p><a href="http://desmond.imageshack.us/Himg695/scaled.php?server=695&amp;filename=chunkgroupsjpeg.png&amp;res=medium" rel="nofollow noreferrer">Stream http://desmond.imageshack.us/Himg695/scaled.php?server=695&amp;filename=chunkgroupsjpeg.png&amp;res=medium</a></p> <p>Once receiving a NO_MORE_DATA response from getResultData, a call to getNextItem will iterate the stream allowing me to start calls to getResultData again. Once getNextItem returns STREAM_FINISHED, that's all she wrote; I have my data.</p> <p>Now, I wish to remodel this phenomenon with either Date.Iteratee or Data.Enumerator. Inasmuch as my existing Data.Iteratee solution works, it yet seems very naive and I feel as if I should be modeling this with nested iteratees as opposed to one big iteratee blob which is how my solution is currently implemented.</p> <p>I have been looking at the code of Data.Iteratee 0.8.6.2 and I am a bit confused when it comes to the nested stuff.</p> <p><strong>Are nested iteratees the proper course of action? If so, how would one model this with nested iteratees?</strong></p> <p>Regards</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload