I didn&#39;t analyze it but anytime I see &quot;M.insertWith&quot; I am just in doubt - do you know about a strict version M.insertWith&#39; ?<br><br><div class="gmail_quote">2012/10/24 Stefan Klinger <span dir="ltr">&lt;<a href="mailto:all-lists@stefan-klinger.de" target="_blank">all-lists@stefan-klinger.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2012-Oct-22 14:23 (-0700), Eugene Kirpichov wrote with possible deletions:<br>
<div class="im">&gt;<br>
&gt;     fwd = foldr (\(x,y) -&gt; M.insertWith (++) x [y]) M.empty $ S.toList g<br>
&gt;<br>
&gt; Use foldl&#39; here, foldr is absolutely useless here and it only consumes<br>
&gt; the stack space as your operation is strict.<br>
<br>
</div>Thank you very much for that.  I&#39;ll review the code under strictness<br>
aspects.<br>
<div class="im"><br>
&gt; As for the actual code: I&#39;d prefer the code itself to be more<br>
&gt; readable, rather than have a lot of literate comments around it;<br>
<br>
</div>I like comments documenting why something&#39;s done, complementing the code<br>
which tells what&#39;s done.<br>
<div class="im"><br>
&gt; currently, IMO all the uncurry&#39;s, flips, eithers, maybes and<br>
&gt; point-free style hurt readability heavily.<br>
<br>
</div>I agree.  Between babbling bloated and incomprehensible terse, my code<br>
is certainly towards the terse extreme.  For me, that&#39;s a balancing act<br>
that I find hard to do right.<br>
<div class="im"><br>
&gt; I&#39;ll probably try to write my own version as an exercise :)<br>
<br>
</div>Cool!  I&#39;d like to see that...<br>
<br>
Cheers!<br>
<div class="HOEnZb"><div class="h5">Stefan<br>
<br>
<br>
--<br>
Stefan Klinger                                      o/klettern<br>
                                                    /\/  bis zum<br>
send plaintext only - max size 32kB - no spam         \   Abfallen<br>
<a href="http://stefan-klinger.de" target="_blank">http://stefan-klinger.de</a><br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>