I didn't analyze it but anytime I see "M.insertWith" I am just in doubt - do you know about a strict version M.insertWith' ?<br><br><div class="gmail_quote">2012/10/24 Stefan Klinger <span dir="ltr"><<a href="mailto:all-lists@stefan-klinger.de" target="_blank">all-lists@stefan-klinger.de</a>></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">><br>
> fwd = foldr (\(x,y) -> M.insertWith (++) x [y]) M.empty $ S.toList g<br>
><br>
> Use foldl' here, foldr is absolutely useless here and it only consumes<br>
> the stack space as your operation is strict.<br>
<br>
</div>Thank you very much for that. I'll review the code under strictness<br>
aspects.<br>
<div class="im"><br>
> As for the actual code: I'd prefer the code itself to be more<br>
> readable, rather than have a lot of literate comments around it;<br>
<br>
</div>I like comments documenting why something's done, complementing the code<br>
which tells what's done.<br>
<div class="im"><br>
> currently, IMO all the uncurry's, flips, eithers, maybes and<br>
> 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's a balancing act<br>
that I find hard to do right.<br>
<div class="im"><br>
> I'll probably try to write my own version as an exercise :)<br>
<br>
</div>Cool! I'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>