From: "Erdi, Gergo" <Gergo.Erdi@sc.com>
To: 'GHC' <ghc-devs@haskell.org>
CC: "Montelatici, Raphael Laurent" <Raphael.Montelatici@sc.com>
Subject: mkIfaceTc panics with "lookupVers1"
Thread-Topic: mkIfaceTc panics with "lookupVers1"
Thread-Index: Add3u1q1Hhdib6IdTVCEsMPKuxyDqw==
Date: Tue, 13 Jul 2021 08:02:09 +0000
Message-ID:  <HK0PR03MB486781A43223F5B68C7743F0E9149@HK0PR03MB4867.apcprd03.prod.outlook.com>
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
X-MS-Exchange-Organization-RecordReviewCfmType: 0
msip_labels: MSIP_Label_ebbfc019-7f88-4fb6-96d6-94ffadd4b772_Enabled=True; 
 =?utf-8?q?MSIP=5FLabel=5Febbfc019-7f88-4fb6-96d6-94ffadd4b772=5FSiteId=3Db4?=
 =?utf-8?q?4900f1-2def-4c3b-9ec6-9020d604e19e=3B?=
 MSIP_Label_ebbfc019-7f88-4fb6-96d6-94ffadd4b772_Owner=1402529@zone1.scb.net; 
 =?utf-8?q?MSIP=5FLabel=5Febbfc019-7f88-4fb6-96d6-94ffadd4b772=5FSetDate=3D2?=
 =?utf-8?q?021-07-13T08=3A02=3A07=2E9314275Z=3B?=
 MSIP_Label_ebbfc019-7f88-4fb6-96d6-94ffadd4b772_Name=Public;
 MSIP_Label_ebbfc019-7f88-4fb6-96d6-94ffadd4b772_Application=Microsoft Azure
 Information Protection; =?utf-8?q?MSIP=5FLabel=5Febbfc019-7f88-4fb6-96d6-94?=
 =?utf-8?q?ffadd4b772=5FActionId=3D60819b34-15dc-4225-9eed-387205bf22fb=3B?=
 MSIP_Label_ebbfc019-7f88-4fb6-96d6-94ffadd4b772_Extended_MSFT_Method=Manual
x-ms-exchange-organization-originalclientipaddress: 165.225.112.211
x-ms-exchange-organization-originalserveripaddress: 2603:1096:203:b2::20
x-ms-exchange-organization-submissionquotaskipped: False
Content-Type: multipart/mixed;
	boundary="_006_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_"
MIME-Version: 1.0

--_006_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_
Content-Type: multipart/alternative;
	boundary="_000_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_"

--_000_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

PUBLIC


Hi,



I'm trying to use `mkIfaceTc` to make a ModIface from the results of typech=
ecking. Everything goes well until it gets to `makeFullIface`, where it fai=
ls to find some imported fingerprints:



hello: hello: panic! (the 'impossible' happened)

  (GHC version 9.0.1:

        lookupVers1



MyPrim Foo

Call stack:

    CallStack (from HasCallStack):

      callStackDoc, called at compiler/GHC/Utils/Outputable.hs:1230:37 in g=
hc-lib-9.0.1.20210623-3xx7a2u7IkN9vKAnkscROb:GHC.Utils.Outputable

      pprPanic, called at compiler/GHC/Iface/Recomp.hs:1455:19 in ghc-lib-9=
.0.1.20210623-3xx7a2u7IkN9vKAnkscROb:GHC.Iface.Recomp



I am using the GHC API to load my modules differently than what GHC itself =
does; I am attaching the full code, but perhaps to note is that I am creati=
ng ModSummarys one by one and then typechecking and adding them to the modu=
leNameProviderMap in dependency order. Also, I am using `downsweep` directl=
y instead of `depanal`, because the latter's `flushFinderCaches` was breaki=
ng my inter-unit imports.



Because the attached code is a minimized version of something larger, some =
parts of it may seem to be doing things in a roundabout way but that's beca=
use in the real program all those degrees of freedom are used. In case that=
 matters, the only packages in my package DB are  rts, ghc-prim-0.7.0 and g=
hc-bignum-1.0.



So my question is basically, what am I doing wrong? Why is fingerprinting f=
ailing on `Top.hs`'s import of `MyPrim.hs`, and how do I fix that, while st=
ill keeping this total control over when and how modules are typechecked an=
d loaded?



Thanks,

            Gergo




--_000_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"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:"Lucida Console";
	panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
span.EmailStyle22
	{mso-style-type:personal-compose;
	font-family:"Arial",sans-serif;
	color:windowtext;
	font-weight:normal;
	font-style:normal;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:1492872565;
	mso-list-type:hybrid;
	mso-list-template-ids:1342062680 -1723419700 134807555 134807557 134807553=
 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0F0;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:Arial;}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l0:level3
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l0:level4
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level5
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l0:level6
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l0:level7
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l0:level8
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l0:level9
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l1
	{mso-list-id:1706826864;
	mso-list-type:hybrid;
	mso-list-template-ids:-4569534 727984062 134807555 134807557 134807553 134=
807555 134807557 134807553 134807555 134807557;}
@list l1:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0F0;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:Arial;}
@list l1:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l1:level3
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l1:level4
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l1:level5
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l1:level6
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l1:level7
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l1:level8
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l1:level9
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l2
	{mso-list-id:2082167144;
	mso-list-type:hybrid;
	mso-list-template-ids:-1100319764 -1989772540 134807555 134807557 13480755=
3 134807555 134807557 134807553 134807555 134807557;}
@list l2:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0F0;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:38.25pt;
	text-indent:-20.25pt;
	font-family:Wingdings;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:Arial;}
@list l2:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l2:level3
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l2:level4
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l2:level5
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l2:level6
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
@list l2:level7
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l2:level8
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:"Courier New";}
@list l2:level9
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Wingdings;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-GB" link=3D"#525355" vlink=3D"#0473EA">
<p class=3D"msipheader7557e74b" align=3D"Left" style=3D"margin:0"><span sty=
le=3D"font-size:9.0pt;font-family:Arial;color:#317100">PUBLIC</span></p>
<br>
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">Hi,<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">I&#8217;m trying to use `mkIfaceTc` to make a ModIfac=
e from the results of typechecking. Everything goes well until it gets to `=
makeFullIface`, where it fails to find some imported
 fingerprints:<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">hello: hello: panic! (the =
'impossible' happened)<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">&nbsp; (GHC version 9.0.1:=
<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; lookupVers1<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;"><o:p>&nbsp;</o:p></span></=
p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">MyPrim Foo<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">Call stack:<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">&nbsp;&nbsp;&nbsp; CallSta=
ck (from HasCallStack):<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; callStackDoc, called at compiler/GHC/Utils/Outputable.hs:1230:37 in gh=
c-lib-9.0.1.20210623-3xx7a2u7IkN9vKAnkscROb:GHC.Utils.Outputable<o:p></o:p>=
</span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; pprPanic, called at compiler/GHC/Iface/Recomp.hs:1455:19 in ghc-lib-9.=
0.1.20210623-3xx7a2u7IkN9vKAnkscROb:GHC.Iface.Recomp<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;"><o:p>&nbsp;</o:p></span></=
p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif">I am using the GHC API =
to load my modules differently than what GHC itself does; I am attaching th=
e full code, but perhaps to note is that I am creating
 ModSummarys one by one and then typechecking and adding them to the module=
NameProviderMap in dependency order. Also, I am using `downsweep` directly =
instead of `depanal`, because the latter&#8217;s `flushFinderCaches` was br=
eaking my inter-unit imports.<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif"><o:p>&nbsp;</o:p></span=
></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Because the attached co=
de is a minimized version of something larger, some parts of it may seem to=
 be doing things in a roundabout way but that&#8217;s
 because in the real program all those degrees of freedom are used. In case=
 that matters, the only packages in my package DB are &nbsp;rts, ghc-prim-0=
.7.0 and ghc-bignum-1.0.<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif"><o:p>&nbsp;</o:p></span=
></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif">So my question is basic=
ally, what am I doing wrong? Why is fingerprinting failing on `Top.hs`&#821=
7;s import of `MyPrim.hs`, and how do I fix that, while
 still keeping this total control over when and how modules are typechecked=
 and loaded?<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif"><o:p>&nbsp;</o:p></span=
></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Thanks,<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:10.0pt;font-family:&quot;Arial&quot;,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Gergo<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-autospace:none"><span style=3D"font-si=
ze:9.0pt;font-family:&quot;Lucida Console&quot;"><o:p>&nbsp;</o:p></span></=
p>
</div>
</body>
</html>

--_000_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_--

--_006_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_
Content-Type: application/octet-stream; name="Top.hs"
Content-Description: Top.hs
Content-Disposition: attachment; filename="Top.hs"; size=83;
	creation-date="Tue, 13 Jul 2021 07:55:00 GMT";
	modification-date="Tue, 13 Jul 2021 08:02:09 GMT"
Content-Transfer-Encoding: base64

ey0jIExBTkdVQUdFIE5vSW1wbGljaXRQcmVsdWRlICMtfQptb2R1bGUgVG9wIHdoZXJlCgppbXBv
cnQgTXlQcmltCgp4IDo6IEZvbwp4ID0geAo=

--_006_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_
Content-Type: application/octet-stream; name="Main.hs"
Content-Description: Main.hs
Content-Disposition: attachment; filename="Main.hs"; size=4236;
	creation-date="Tue, 13 Jul 2021 07:55:00 GMT";
	modification-date="Tue, 13 Jul 2021 08:02:09 GMT"
Content-Transfer-Encoding: base64

bW9kdWxlIE1haW4gKG1haW4pIHdoZXJlCgppbXBvcnQgcXVhbGlmaWVkIFBhdGhzX2doY19saWIg
YXMgR0hDCmltcG9ydCBQYXRoc19oZWxsbwoKaW1wb3J0IEdIQyBoaWRpbmcgKGxvYWRNb2R1bGUp
CmltcG9ydCBHSEMuRHJpdmVyLk1vbmFkCmltcG9ydCBHSEMuRHJpdmVyLlNlc3Npb24KaW1wb3J0
IEdIQy5Vbml0LlN0YXRlCmltcG9ydCBHSEMuVW5pdC5UeXBlcwppbXBvcnQgR0hDLlVuaXQuTW9k
dWxlLk5hbWUKaW1wb3J0IEdIQy5Vbml0Lk1vZHVsZS5FbnYKaW1wb3J0IEdIQy5Ecml2ZXIuVHlw
ZXMKaW1wb3J0IEdIQy5Ecml2ZXIuTWFrZQppbXBvcnQgR0hDLlRjLlR5cGVzCmltcG9ydCBxdWFs
aWZpZWQgRGF0YS5NYXAgYXMgTQppbXBvcnQgQ29udHJvbC5Nb25hZAppbXBvcnQgRGF0YS5NYXli
ZQppbXBvcnQgR0hDLklmYWNlLk1ha2UKaW1wb3J0IEdIQy5VdGlscy5FcnJvcgppbXBvcnQgR0hD
LkRhdGEuQmFnCmltcG9ydCBEYXRhLkVpdGhlcgppbXBvcnQgU3lzdGVtLkZpbGVQYXRoCmltcG9y
dCBHSEMuRGF0YS5GYXN0U3RyaW5nCgpteVVuaXRJZCA6OiBVbml0SWQKbXlVbml0SWQgPSBVbml0
SWQgJCBmc0xpdCAibXktdW5pdCIKCm15VW5pdCA6OiBVbml0Cm15VW5pdCA9IFJlYWxVbml0IChE
ZWZpbml0ZSBteVVuaXRJZCkKCm1haW4gOjogSU8gKCkKbWFpbiA9IGRvCiAgICBsaWJkaXIgPC0g
R0hDLmdldERhdGFEaXIKICAgIHJ1bkdoYyAoSnVzdCBsaWJkaXIpICQgZG8KICAgICAgICBzZXR1
cAoKICAgICAgICBsZXQgZmlsZVRhcmdldCBtb2QgPSBUYXJnZXQKICAgICAgICAgICAgICAgIHsg
dGFyZ2V0SWQgPSBUYXJnZXRGaWxlICgiaW5wdXQvbG9va3VwVmVyczEvIiA8PiBtb2R1bGVOYW1l
U2xhc2hlcyBtb2QgPD4gIi5ocyIpIE5vdGhpbmcKICAgICAgICAgICAgICAgICwgdGFyZ2V0QWxs
b3dPYmpDb2RlID0gRmFsc2UKICAgICAgICAgICAgICAgICwgdGFyZ2V0Q29udGVudHMgPSBOb3Ro
aW5nCiAgICAgICAgICAgICAgICB9CgogICAgICAgIHNldFRhcmdldHMgW10KICAgICAgICBsZXQg
cHJlcGFyZSB1bml0IG1vZCA9IGRvCiAgICAgICAgICAgICAgICBhZGRUYXJnZXQgJCBmaWxlVGFy
Z2V0IG1vZAoKICAgICAgICAgICAgICAgIChlcnJzLCBtc3MpIDwtIGRvCiAgICAgICAgICAgICAg
ICAgICAgZW52IDwtIGdldFNlc3Npb24KICAgICAgICAgICAgICAgICAgICBlbnYgPC0gcmV0dXJu
ICQgc2V0SG9tZVVuaXQgKHRvVW5pdElkIHVuaXQpIGVudgogICAgICAgICAgICAgICAgICAgIGxp
ZnRJTyAkIHBhcnRpdGlvbkVpdGhlcnMgPCQ+IGRvd25zd2VlcCBlbnYgW10gW10gRmFsc2UKICAg
ICAgICAgICAgICAgIHJlcG9ydEVycm9ycyBlcnJzCgogICAgICAgICAgICAgICAgbGV0IG1lbnYg
PSBta01vZHVsZUVudiBbKG1zX21vZCBtcywgbXMpIHwgbXMgPC0gbXNzXQoKICAgICAgICAgICAg
ICAgIHJldHVybiAkIGZyb21NYXliZSAoZXJyb3IgJCB1bndvcmRzIFsibG9va3VwTW9kdWxlRW52
Iiwgd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TWFwIHVzCiAgICAgICAgfQoKICAg
IGV4dGVuZEhQVCBlbnYgPSBlbnZ7IGhzY19IUFQgPSBocHQsIGhzY190eXBlX2Vudl92YXIgPSBO
b3RoaW5nIH0KICAgICAgd2hlcmUKICAgICAgICBocHQgPSBhZGRUb0hwdCAoaHNjX0hQVCBlbnYp
IChtb2R1bGVOYW1lIG1vZCkgbW9kX2luZm8KCgp3aXRoVW5pdFN0YXRlIDo6IFVuaXRTdGF0ZSAt
PiBNb2RTdW1tYXJ5IC0+IE1vZFN1bW1hcnkKd2l0aFVuaXRTdGF0ZSB1cyBtcyA9IG1zCiAgICB7
IG1zX2hzcHBfb3B0cyA9IChtc19oc3BwX29wdHMgbXMpCiAgICAgICAgeyB1bml0U3RhdGUgPSB1
cwogICAgICAgIH0KICAgIH0K

--_006_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_
Content-Type: application/octet-stream; name="MyPrim.hs"
Content-Description: MyPrim.hs
Content-Disposition: attachment; filename="MyPrim.hs"; size=89;
	creation-date="Tue, 13 Jul 2021 07:55:00 GMT";
	modification-date="Tue, 13 Jul 2021 08:02:09 GMT"
Content-Transfer-Encoding: base64

ey0jIExBTkdVQUdFIE5vSW1wbGljaXRQcmVsdWRlICMtfQptb2R1bGUgTXlQcmltCiAgICAoIEZv
bwogICAgKSB3aGVyZQoKZGF0YSBGb28gPSBNa0Zvbwo=

--_006_HK0PR03MB486781A43223F5B68C7743F0E9149HK0PR03MB4867apcp_--
