<div dir="ltr">Turned out that I didn&#39;t need fold at all, just a proper groupBy.<div><br></div><div>As for these lines</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">module Main (</blockquote>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">    main</blockquote>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">) where</blockquote>
</blockquote><div><br></div></div><div>they were generated by Leksah. Do you suggest to remove them? And what about Leksah as an IDE: do you use it?</div><div><br></div><div><br></div><div>Giacomo</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 15, 2013 at 9:35 AM, Giacomo Tesio <span dir="ltr">&lt;<a href="mailto:giacomo@tesio.it" target="_blank">giacomo@tesio.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks a lot!<div><br></div><div>Yesterday on freenode&#39;s #haskell channel Cane noted how my laziness problem reside in the foldl use in <span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:14px">foldTradingSample</span>.</div>

<div>I have to turn it into a foldr (but I&#39;m still unsure how...)</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>Giacomo</div></font></span></div><div class="HOEnZb"><div class="h5">
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 15, 2013 at 12:46 AM, Henk-Jan van Tuyl <span dir="ltr">&lt;<a href="mailto:hjgtuyl@chello.nl" target="_blank">hjgtuyl@chello.nl</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Tue, 14 May 2013 11:22:27 +0200, Giacomo Tesio &lt;<a href="mailto:giacomo@tesio.it" target="_blank">giacomo@tesio.it</a>&gt; wrote:<br>


<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, I&#39;m trying to improve a small haskell program of mine.<br>
</blockquote></div>
:<br>
<br>
Some remarks:<br>
<br>
0) Use hlint (available on Hackage) for improvement suggestions<br>
1) You don&#39;t have to write the module heading in Main.hs, it is not a library (why export main?)<br>
2) Change &quot;print&quot; to &quot;putStrLn&quot; if you want to display messages without quotes<br>
2) switchArgs is only partially defined, add something like:<br>
     switchArgs [x] = putStrLn $ &quot;Unknown tool: &quot; ++ x<br>
3) Use shorter lines, for example change:<div><br>
  importTrades outDir csvFile = transformFile csvFile (foldTradingSample.<u></u>getTickWriteTrades)   (saveTradingSamples outDir)<br>
<br></div>
to:<div><br>
  importTrades outDir csvFile =<br>
    transformFile<br>
      csvFile<br>
      (foldTradingSample.<u></u>getTickWriteTrades)<br>
      (saveTradingSamples outDir)<br></div>
4) It is considered good practice, to write the function<br>
   composition operator between spaces (change f.g to f . g)<br>
<br>
I have analyze your software further to see how sufficient laziness can be reached.<br>
<br>
Regards,<br>
Henk-Jan van Tuyl<br>
<br>
<br>
-- <br>
Folding@home<br>
What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world&#39;s biggest networked computer and get us closer sooner. Watch the video.<br>
<a href="http://folding.stanford.edu/" target="_blank">http://folding.stanford.edu/</a><br>
<br>
<br>
<a href="http://Van.Tuyl.eu/" target="_blank">http://Van.Tuyl.eu/</a><br>
<a href="http://members.chello.nl/hjgtuyl/tourdemonad.html" target="_blank">http://members.chello.nl/<u></u>hjgtuyl/tourdemonad.html</a><br>
Haskell programming<br>
--<br>
<br>
______________________________<u></u>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/beginners</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>