On Nov 11, 2014 3:56 AM, "Kim-Ee Yeoh" <k...@atamo.com> wrote: > > From the patch fragment at > > https://phabricator.haskell.org/D455?id=1311#inline-3123 > > What's the justification for expanding out the definition of mapM from "sequence . map f" into do-notation and duplicated code? > > Observe how mapM now duplicates code from sequence.
One good option might be to redefine sequence in terms of mapM. > 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." 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.
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs