<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;}
@font-face
{font-family:"Segoe UI Emoji";
panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
{font-family:"Lucida Console";
panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#525355;
text-decoration:underline;}
p.Code, li.Code, div.Code
{mso-style-name:Code;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:22.7pt;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-language:EN-US;
font-weight:bold;}
p.msipheader7557e74b, li.msipheader7557e74b, div.msipheader7557e74b
{mso-style-name:msipheader7557e74b;
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.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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="#525355" vlink="#0473EA" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">As for opening a ticket – a big part of the problem is that I don’t even know yet if I’m doing something wrong, or GHC is! So it’s not clear what the
ticket would even be for – “I’m using the GHC API wrongly” is not a strong bug report
</span><span style="font-size:10.0pt;font-family:"Segoe UI Emoji",sans-serif">😊</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Plenty of tickets turn out to be non-bugs. But they are still searchable, and form a permanent record that may help others, perhaps in unexpected ways. So I encourage you to
do so.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">I successfully compiled the attached Main.hs with HEAD, passing ‘-package ghc’ as a command line argument.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">When I run it I get
<o:p></o:p></span></p>
<p class="Code">simonpj@MSRC-3645512:~/tmp$ ./gergo<o:p></o:p></p>
<p class="Code">Missing file: /home/simonpj/code/HEAD-1/compiler/stage1/build/settings<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">So now I’m stuck again.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:8.0pt;mso-fareast-language:EN-GB">PS: I am leaving Microsoft at the end of November 2021, at which point
<a href="mailto:simonpj@microsoft.com"><span style="color:#0563C1">simonpj@microsoft.com</span></a> will cease to work. Use
<a href="mailto:simon.peytonjones@gmail.com"><span style="color:#0563C1">simon.peytonjones@gmail.com</span></a> instead. (For now, it just forwards to simonpj@microsoft.com.)<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></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="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> Erdi, Gergo <Gergo.Erdi@sc.com>
<br>
<b>Sent:</b> 19 October 2021 02:57<br>
<b>To:</b> Simon Peyton Jones <simonpj@microsoft.com>; 'Matthew Pickering' <matthewtpickering@gmail.com><br>
<b>Cc:</b> Montelatici, Raphael Laurent <Raphael.Montelatici@sc.com>; 'GHC' <ghc-devs@haskell.org><br>
<b>Subject:</b> RE: Specialisation doesn't kick in -- NOW WITH MINIMAL WORKING EXAMPLE (RE: Instantiation of overloaded definition *in Core*)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#317100">PUBLIC<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<div>
<p class="msipheader7557e74b" style="margin:0cm"><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#317100">PUBLIC</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Thanks for looking into this!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">`Paths_ghc_lib` is referenced just because I am using GHC via ghc-lib. You can of course instead use a local full build of GHC for the libDir. Please find an updated version
attached that does that – you’ll just have to adapt the definition of `libDir` to your environment.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">As for opening a ticket – a big part of the problem is that I don’t even know yet if I’m doing something wrong, or GHC is! So it’s not clear what the ticket would even be for
– “I’m using the GHC API wrongly” is not a strong bug report </span><span style="font-size:10.0pt;font-family:"Segoe UI Emoji",sans-serif">😊</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<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="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>>
<br>
<b>Sent:</b> Saturday, October 16, 2021 12:52 AM<br>
<b>To:</b> Erdi, Gergo <<a href="mailto:Gergo.Erdi@sc.com">Gergo.Erdi@sc.com</a>>; 'Matthew Pickering' <<a href="mailto:matthewtpickering@gmail.com">matthewtpickering@gmail.com</a>><br>
<b>Cc:</b> Montelatici, Raphael Laurent <<a href="mailto:Raphael.Montelatici@sc.com">Raphael.Montelatici@sc.com</a>>; 'GHC' <<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>><br>
<b>Subject:</b> [External] RE: Specialisation doesn't kick in -- NOW WITH MINIMAL WORKING EXAMPLE (RE: Instantiation of overloaded definition *in Core*)<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal">I could not compile Main.hs:<o:p></o:p></p>
<p class="Code">~/code/HEAD-1/inplace/bin/ghc-stage1 -c Gergo.hs -package ghc<o:p></o:p></p>
<p class="Code"><o:p> </o:p></p>
<p class="Code">Gergo.hs:4:1: error:<o:p></o:p></p>
<p class="Code"> Could not find module ‘Paths_ghc_lib’<o:p></o:p></p>
<p class="Code"> Use -v (or `:set -v` in ghci) to see a list of the files searched for.<o:p></o:p></p>
<p class="Code"> |<o:p></o:p></p>
<p class="Code">4 | import qualified Paths_ghc_lib as GHC<o:p></o:p></p>
<p class="Code"> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<o:p></o:p></p>
<p class="Code">simonpj@MSRC-3645512:~/tmp$<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Would you like to open a ticket rather than do this by email?<o:p></o:p></p>
<p class="MsoNormal"><br>
Simon<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:8.0pt;mso-fareast-language:EN-GB">PS: I am leaving Microsoft at the end of November 2021, at which point
<a href="mailto:simonpj@microsoft.com"><span style="color:#0563C1">simonpj@microsoft.com</span></a> will cease to work. Use
<a href="mailto:simon.peytonjones@gmail.com"><span style="color:#0563C1">simon.peytonjones@gmail.com</span></a> instead. (For now, it just forwards to
<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>.)<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></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="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> Erdi, Gergo <<a href="mailto:Gergo.Erdi@sc.com">Gergo.Erdi@sc.com</a>>
<br>
<b>Sent:</b> 15 October 2021 05:35<br>
<b>To:</b> Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>>; 'Matthew Pickering' <<a href="mailto:matthewtpickering@gmail.com">matthewtpickering@gmail.com</a>><br>
<b>Cc:</b> Montelatici, Raphael Laurent <<a href="mailto:Raphael.Montelatici@sc.com">Raphael.Montelatici@sc.com</a>>; 'GHC' <<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>><br>
<b>Subject:</b> RE: Specialisation doesn't kick in -- NOW WITH MINIMAL WORKING EXAMPLE (RE: Instantiation of overloaded definition *in Core*)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#317100">PUBLIC<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<div>
<p class="msipheader7557e74b" style="margin:0cm"><span style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#317100">PUBLIC</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">OK I now have a standalone demonstrator that shows, at least, that the default method implementation is not specialized. With the attached input programs, the resulting Core
(using GHC </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB">e46edfcf47d674731935b2ea1443cc7927e071fb) is as follows (only showing the relevant parts):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">seq :: forall (m :: * -> *) a b. Monad m => m a -> m b -> m b<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">seq<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> = \ (@(m :: * -> *)) (v_srS [Occ=Once1!] :: Monad m) -><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> case v_srS of { C:Monad _ [Occ=Dead] v_srV [Occ=Once1] -> v_srV }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">$dmseq :: forall (m :: * -> *) a b. Monad m => m a -> m b -> m b<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">$dmseq<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> = \ (@(m :: * -> *))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> ($dMonad [Occ=Once1] :: Monad m)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> (@a)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> (@b)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> (ma [Occ=Once1] :: m a)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> (mb [Occ=OnceL1] :: m b) -><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> let {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> sat_ss0 [Occ=Once1] :: a -> m b<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> [LclId]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> sat_ss0 = \ _ [Occ=Dead] -> mb } in<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"> bind @m $dMonad @a @b ma sat_ss0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">$fMonadIO :: Monad IO<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">$fMonadIO = C:Monad @IO bindIO $fMonadIO_$cseq;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">$fMonadIO_$cseq :: forall a b. IO a -> IO b -> IO b<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">$fMonadIO_$cseq = \ (@a) (@b) -> $dmseq @IO $fMonadIO @a @b;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">foo :: IO ()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";mso-fareast-language:EN-GB">foo = seq @IO $fMonadIO @() @() ioA ioA<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB">If I turn on Opt_D_dump_spec, I can see that specializer *<b>is</b>* running, it just doesn’t *<b>do</b>* anything.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"><br>
This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard
Chartered Bank and their subsidiaries at https: //www.sc.com/en/our-locations<br>
<br>
Where you have a Financial Markets relationship with Standard Chartered PLC, Standard Chartered Bank and their subsidiaries (the "Group"), information on the regulatory standards we adhere to and how it may affect you can be found in our Regulatory Compliance
Statement at https: //www.sc.com/rcs/ and Regulatory Compliance Disclosures at http: //www.sc.com/rcs/fm<br>
<br>
Insofar as this communication is not sent by the Global Research team and contains any market commentary, the market commentary has been prepared by the sales and/or trading desk of Standard Chartered Bank or its affiliate. It is not and does not constitute
research material, independent research, recommendation or financial advice. Any market commentary is for information purpose only and shall not be relied on for any other purpose and is subject to the relevant disclaimers available at https: //www.sc.com/en/regulatory-disclosures/#market-disclaimer.<br>
<br>
Insofar as this communication is sent by the Global Research team and contains any research materials prepared by members of the team, the research material is for information purpose only and shall not be relied on for any other purpose, and is subject to
the relevant disclaimers available at https: //research.sc.com/research/api/application/static/terms-and-conditions.
<br>
<br>
Insofar as this e-mail contains the term sheet for a proposed transaction, by responding affirmatively to this e-mail, you agree that you have understood the terms and conditions in the attached term sheet and evaluated the merits and risks of the transaction.
We may at times also request you to sign the term sheet to acknowledge the same.<br>
<br>
Please visit https: //www.sc.com/en/regulatory-disclosures/dodd-frank/ for important information with respect to derivative products.<o:p></o:p></span></p>
</div>
</div>
</body>
</html>