<p dir="ltr"><br>
On Nov 11, 2014 3:56 AM, "Kim-Ee Yeoh" <<a href="mailto:ky3@atamo.com">ky3@atamo.com</a>> wrote:<br>
><br>
> From the patch fragment at<br>
><br>
> <a href="https://phabricator.haskell.org/D455?id=1311#inline-3123">https://phabricator.haskell.org/D455?id=1311#inline-3123</a><br>
><br>
> What's the justification for expanding out the definition of mapM from "sequence . map f" into do-notation and duplicated code?<br>
><br>
> Observe how mapM now duplicates code from sequence.</p>
<p dir="ltr">One good option might be to redefine sequence in terms of mapM.</p>
<p dir="ltr">> The absence of benchmarks is bad enough. What's worse is that the given excuse boils down to "Pity the poor compiler! Let's take over its work instead. Like, just in case, you know."</p>
<p dir="ltr">The excuse is that it actually makes a big difference for nofib. Why? I would have to guess it relates to what inlines when. The inliner is a finicky beast. In response to your insults, I will say that although GHC has beautiful ideas in it, a lot of the details of the optimization passes and how they fit together *are* a bit of a crapshoot, chosen by benchmarks rather than theory. Theory sometimes comes up behind and explains why the benchmarks do what they do, but you can't expect every little change to be backed up by some deep theoretical reason.</p>