<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.Code, li.Code, div.Code
        {mso-style-name:Code;
        mso-style-link:"Code Char";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Courier New";
        color:#1F497D;}
span.CodeChar
        {mso-style-name:"Code Char";
        mso-style-link:Code;
        font-family:"Courier New";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
.MsoPapDefault
        {mso-style-type:export-only;
        margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:0cm;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Well, I’d
<i>much</i> rather avoid creating the duplication in the first place, than to create and try to CSE it away.  Others have suggested ways of doing so, following the pattern of existing RULES.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> David Feuer [mailto:david.feuer@gmail.com]
<br>
<b>Sent:</b> 15 August 2014 16:41<br>
<b>To:</b> ghc-devs; Simon Peyton Jones<br>
<b>Subject:</b> Re: [GHC] #9434: GHC.List.reverse does not fuse<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>I'm having trouble when it doesn't fuse—it ends up with duplicate bindings at the top level, because build gets inlined n times, and the result lifted out. Nothing's *wrong* with the code, except that there are multiple copies of it.<o:p></o:p></p>
<div>
<p class="MsoNormal">On Aug 15, 2014 10:58 AM, "GHC" <<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">#9434: GHC.List.reverse does not fuse<br>
-------------------------------------+-------------------------------------<br>
              Reporter:  dfeuer      |            Owner:<br>
                  Type:  bug         |           Status:  new<br>
              Priority:  normal      |        Milestone:<br>
             Component:              |          Version:  7.9<br>
  libraries/base                     |         Keywords:<br>
            Resolution:              |     Architecture:  Unknown/Multiple<br>
      Operating System:              |       Difficulty:  Easy (less than 1<br>
  Unknown/Multiple                   |  hour)<br>
       Type of failure:  Runtime     |       Blocked By:<br>
  performance bug                    |  Related Tickets:<br>
             Test Case:              |<br>
              Blocking:              |<br>
Differential Revisions:              |<br>
-------------------------------------+-------------------------------------<br>
<br>
Comment (by simonpj):<br>
<br>
 Great.  Just check that when fusion ''doesn't'' take place, the result is<br>
 good. And do a `nofib` comparison for good luck. Then submit a patch.<br>
<br>
 Thanks for doing all this work on fusion, David.<br>
<br>
 Simon<br>
<br>
--<br>
Ticket URL: <<a href="http://ghc.haskell.org/trac/ghc/ticket/9434#comment:2" target="_blank">http://ghc.haskell.org/trac/ghc/ticket/9434#comment:2</a>><br>
GHC <<a href="http://www.haskell.org/ghc/" target="_blank">http://www.haskell.org/ghc/</a>><br>
The Glasgow Haskell Compiler<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>