<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:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-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.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
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:11.0pt;
font-family:"Courier New";}
span.CodeChar
{mso-style-name:"Code Char";
mso-style-link:Code;
font-family:"Courier New";}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:EN-GB;}
span.hljs-title
{mso-style-name:hljs-title;}
span.hljs-type
{mso-style-name:hljs-type;}
span.hljs-keyword
{mso-style-name:hljs-keyword;}
span.EmailStyle31
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:834759209;
mso-list-template-ids:205151578;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:872620845;
mso-list-template-ids:1728500514;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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>I printed out the full [StgTopBinding] list and got:<o:p></o:p></p>
<p class="Code"><span class="hljs-title"><b><span style="font-size:9.5pt;font-family:Consolas;color:#990000;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">let</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">
{<o:p></o:p></span></code></p>
<p class="Code"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> sat_s27NC [</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Occ</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">=</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Once</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">]
:: </span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">IO</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">
</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Timeout</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p></o:p></span></code></p>
<p class="Code"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> [</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">LclId</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">]
=<o:p></o:p></span></code></p>
<p class="Code"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> [] \u [] fmap $fFunctorIO
</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:yellow;mso-highlight:yellow">Timeout</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">
newUnique;<o:p></o:p></span></code></p>
<p class="Code"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">}
</span></code><span class="hljs-keyword"><b><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">in</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">
>>= $fMonadIO sat_s27NC sat_s27NT;<o:p></o:p></span></code></p>
<p class="MsoNormal" style="margin:1.2em!important"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">That does look odd. Can you explain how to reproduce this with HEAD? That is, are we getting a newtype constructor in the argument position of an StgApp in HEAD too?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Newtype “data constructors” are always inlined, which is why I don’t understand what’s happening.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="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">From:</span></b><span lang="EN-US"> ghc-devs <ghc-devs-bounces@haskell.org>
<b>On Behalf Of </b>Christopher Done<br>
<b>Sent:</b> 30 March 2019 14:05<br>
<b>To:</b> GHC developers <ghc-devs@haskell.org><br>
<b>Subject:</b> Newtypes in STG<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p>Hi all,<o:p></o:p></p>
<p style="margin:1.2em!important">Could you offer some insight into newtypes at the STG level? Here’s the<br>
context:<o:p></o:p></p>
<p style="margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo1;margin:1.2em!important 0px!important">
<![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">
</span></span><![endif]>I’m working on this interpreter for STG<br>
(<a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchrisdone%2Fprana&data=02%7C01%7Csimonpj%40microsoft.com%7C4e3af9edea7943b28d5108d6b518bb03%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636895515163475987&sdata=pKqvy%2BbHqITOzm%2FTOSNHdj0w9UT9mtrghK0w9RXQers%3D&reserved=0">https://github.com/chrisdone/prana</a>)
and I’m trying to generate a<br>
pristine AST where all names in it are resolved to something known to<br>
me.<o:p></o:p></p>
<p style="margin-left:0cm;text-indent:-18.0pt;mso-list:l1 level1 lfo1;margin:1.2em!important 0px!important">
<![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">
</span></span><![endif]>I’ve compiled ghc-prim and integer-gmp without issue, and I’m<br>
compiling base and there remains one last frontier which is newtypes.<o:p></o:p></p>
<p style="margin:1.2em!important">These are the culprits pointed out if I compile base:<o:p></o:p></p>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><a href="mailto:chris@precision:~/Work/chrisdone/prana/ghc-8.4/libraries/base-4.11.1.0$">chris@precision:~/Work/chrisdone/prana/ghc-8.4/libraries/base-4.11.1.0$</a> PRANA_INDEX=../prana.idx stack build --exec './Setup build --ghc-options=-O0' --file-watch<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Preprocessing library for base-4.11.1.0..<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Building library for base-4.11.1.0..<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[1 of 244] Compiling GHC.Base<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[2 of 244] Compiling <a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2FGHC.IO&data=02%7C01%7Csimonpj%40microsoft.com%7C4e3af9edea7943b28d5108d6b518bb03%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636895515163485976&sdata=fk29d0sG6L9JTVEVws1efAf%2BwOjKeY9zjhCHZPMZY4M%3D&reserved=0">GHC.IO</a><o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[3 of 244] Compiling GHC.Real<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[4 of 244] Compiling Data.Semigroup.Internal<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">... [snip] ...<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[242 of 244] Compiling Data.Functor.Compose<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[243 of 244] Compiling Data.Fixed<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">[244 of 244] Compiling Data.Complex<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Errors in Data.Foldable:<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Data.Semigroup.Internal.All<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Data.Semigroup.Internal.Any<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Errors in Foreign.Marshal.Pool:<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Foreign.Marshal.Pool.Pool<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Errors in GHC.ExecutionStack.Internal:<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:GHC.ExecutionStack.Internal.StackTrace<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Errors in Data.Bifoldable:<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Data.Semigroup.Internal.All<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Data.Semigroup.Internal.Any<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Errors in System.Timeout:<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:System.Timeout.Timeout<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Errors in Data.Data:<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Foreign.Ptr.WordPtr<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Foreign.Ptr.IntPtr<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Data.Semigroup.Internal.Any<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> Variable name not found: base:Data.Semigroup.Internal.All<o:p></o:p></span></code></pre>
<p style="margin:1.2em!important">I looked these up, and they all appear to be <em>
<span style="font-family:"Calibri",sans-serif">uses</span></em> of a<br>
newtype.<o:p></o:p></p>
<p style="margin:1.2em!important">For example, in the Timeout function:<o:p></o:p></p>
<p style="margin:1.2em!important"><a href="https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fhackage.haskell.org%2Fpackage%2Fbase-4.12.0.0%2Fdocs%2Fsrc%2FSystem.Timeout.html%23timeout&data=02%7C01%7Csimonpj%40microsoft.com%7C4e3af9edea7943b28d5108d6b518bb03%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636895515163485976&sdata=u4tND6ZJNg7qEd8Kl4fNHvfs7JCOXQ9Sq0%2Ff82flDhw%3D&reserved=0">http://hackage.haskell.org/package/base-4.12.0.0/docs/src/System.Timeout.html#timeout</a><o:p></o:p></p>
<p style="margin:1.2em!important">I printed out the full [StgTopBinding] list and got:<o:p></o:p></p>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><span class="hljs-title"><b><span style="font-size:9.5pt;font-family:Consolas;color:#990000;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">let</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> {<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> sat_s27NC [</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Occ</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">=</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Once</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">] :: </span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">IO</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> </span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Timeout</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"><o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> [</span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">LclId</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">] =<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> [] \u [] fmap $fFunctorIO </span></code><span class="hljs-type"><b><span style="font-size:9.5pt;font-family:Consolas;color:#445588;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">Timeout</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> newUnique;<o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">} </span></code><span class="hljs-keyword"><b><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">in</span></b></span><code><span style="font-size:9.5pt;font-family:Consolas;color:#333333;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> >>= $fMonadIO sat_s27NC sat_s27NT;<o:p></o:p></span></code></pre>
<p style="margin:1.2em!important">Oddly (or not?), they’re used as values, not constructors. This error<br>
comes from this part of my code:<o:p></o:p></p>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8">StgSyn.StgApp occ arguments -><o:p></o:p></span></code></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:1.8pt;margin-bottom:0cm;margin-left:1.8pt;margin-bottom:.0001pt;line-height:14.4pt"><code><span style="font-size:9.5pt;font-family:Consolas;border:solid #CCCCCC 1.0pt;padding:6.0pt;background:#F8F8F8"> AppExpr <$> lookupSomeVarId occ <*> traverse fromStgGenArg arguments<o:p></o:p></span></code></pre>
<p style="margin:1.2em!important">If it was used as a constructor, it’d appear in this position, where<br>
looking up the ID would produce a “Data constructor name not found”<br>
error:<o:p></o:p></p>
<p style="margin:1.2em!important">StgSyn.StgConApp dataCon arguments types -><br>
ConAppExpr <$> lookupDataConId dataCon <<em><span style="font-family:"Calibri",sans-serif">> traverse fromStgGenArg arguments <</span></em>><br>
pure (map (const Type) types)<o:p></o:p></p>
<p style="margin:1.2em!important">My understanding of newtypes at this stage is hazy. It seems like:<o:p></o:p></p>
<p style="margin-left:0cm;text-indent:-18.0pt;mso-list:l0 level1 lfo2;margin:1.2em!important 0px!important">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]>They ought to be erased and replaced with coercions by now. If<br>
they’re not replaced, it’s because they’re in a not-quite-id position<br>
like <code><span style="font-size:9.5pt;font-family:Consolas;border:solid #EAEAEA 1.0pt;padding:0cm;background:#F8F8F8">fmap Timeout ...</span></code>. (Arguably these could be fixed in base with a<br>
Data.Coerce.coerce?)<o:p></o:p></p>
<p style="margin-left:0cm;text-indent:-18.0pt;mso-list:l0 level1 lfo2;margin:1.2em!important 0px!important">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]>However, the CoreTidy/PrepPgm processing modules<br>
don’t seem to have removed or replaced these, or introduced a binding<br>
that would do something.<o:p></o:p></p>
<p style="margin:1.2em!important">At this stage what would you recommend? At this point type-checking is<br>
done, and I only care about interpreting the code. So I suppose they<br>
could be <code><span style="font-size:9.5pt;font-family:Consolas;border:solid #EAEAEA 1.0pt;padding:0cm;background:#F8F8F8">id</span></code> for all it matters to the interpreter?<o:p></o:p></p>
<p style="margin:1.2em!important">I imagine they aren’t actually supposed to allocate something here. And<br>
I’m certain that any pattern matching on a newtype is also erased away<br>
by this point.<o:p></o:p></p>
<p style="margin:1.2em!important">Cheers!<o:p></o:p></p>
<p style="margin:1.2em!important">Chris<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>