<div dir="ltr"><div>Dear All,</div><div><br></div>I now have some example code. I have put it on: <a href="http://pastebin.com/D9MPmyVd">http://pastebin.com/D9MPmyVd</a> . <div><br></div><div>vectorBinner is simply of type Vector Int -&gt; Int. I am inputting a 1.5GB CSV on stdin, and would like vectorBinner to run over every single record, outputting results as computed, thus running in constant memory. My programme instead quickly approaches full memory use. Is there any way to work around this?</div>
<div><br></div><div>Justin</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 25 July 2013 17:53, Johan Tibell <span dir="ltr">&lt;<a href="mailto:johan.tibell@gmail.com" target="_blank">johan.tibell@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can use the Incremental or Streaming modules to get more fine<br>
grained control over when new parsed records are produced.<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Jul 25, 2013 at 11:02 AM, Justin Paston-Cooper<br>
&lt;<a href="mailto:paston.cooper@gmail.com">paston.cooper@gmail.com</a>&gt; wrote:<br>
&gt; I hadn&#39;t yet tried profiling the programme. I actually deleted it a few days<br>
&gt; ago. I&#39;m going to try to get something new running, and I will report back.<br>
&gt; On a slightly less related track: Is there any way to use cassava so that I<br>
&gt; can have pure state and also yield CSV lines while my computation is running<br>
&gt; instead of everything at the end as would be with the State monad?<br>
&gt;<br>
&gt;<br>
&gt; On 23 July 2013 22:13, Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jul 23, 2013 at 5:45 PM, Ben Gamari &lt;<a href="mailto:bgamari.foss@gmail.com">bgamari.foss@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Justin Paston-Cooper &lt;<a href="mailto:paston.cooper@gmail.com">paston.cooper@gmail.com</a>&gt; writes:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; Dear All,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Recently I have been doing a lot of CSV processing. I initially tried<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; use the Data.Csv (cassava) library provided on Hackage, but I found<br>
&gt;&gt; &gt;&gt; this to<br>
&gt;&gt; &gt;&gt; still be too slow for my needs. In the meantime I have reverted to<br>
&gt;&gt; &gt;&gt; hacking<br>
&gt;&gt; &gt;&gt; something together in C, but I have been left wondering whether a tidy<br>
&gt;&gt; &gt;&gt; solution might be possible to implement in Haskell.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt; Have you tried profiling your cassava implementation? In my experience<br>
&gt;&gt; &gt; I&#39;ve found it&#39;s quite quick. If you have an example of a slow path I&#39;m<br>
&gt;&gt; &gt; sure Johan (cc&#39;d) would like to know about it.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m always interested in examples of code that is not running fast<br>
&gt;&gt; enough. Send me a reproducible example (preferably as a bug on the<br>
&gt;&gt; GitHub bug tracker) and I&#39;ll take a look.<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>