Re: Failing to get FXP to work in mlton

<[email protected]> Thu, 1 Nov 2018 10:10:02 +0000
Newsgroups gmane.comp.lang.ml.mlton.user
Message-ID <[email protected]>
--===============3240063795488384858==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_5118B4BFE38D48B8A9DB84D910973169data61csiroau_"

--_000_5118B4BFE38D48B8A9DB84D910973169data61csiroau_
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thank you very much for the explanation!  That makes sense.

Michael

From: Matthew Fluet <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Wednesday, 31 October 2018 at 12:15
To: MLton users <[email protected]>
Subject: Re: [MLton-user] Failing to get FXP to work in mlton

Michael,

The type error in your breaking repo is due to the fact that both "src/Pars=
er/parser.mlb" and "src/Unicode/Encode/encode.mlb" reference "src/Unicode/e=
ncoding.sml".  There is significant difference between referring to a .sml =
file and to a .mlb file within a .mlb file.  From http://mlton.org/MLBasisS=
yntaxAndSemantics: "A reference to an SML source file causes the file to be=
 elaborated in the basis extant at the point of reference. A reference to a=
n MLB file causes the basis denoted by that MLB file to be imported=E2=80=
=89 =E2=80=94 =E2=80=89the basis at the point of reference does not affect =
the imported basis. ... An MLB file is elaborated starting in an empty basi=
s. Each MLB file is elaborated and evaluated only once, with the result bei=
ng cached. Subsequent references use the cached value. Thus, any observable=
 effects due to evaluation are not duplicated if the MLB file is referred t=
o multiple times."  In contrast, an SML source file that is referred to mul=
tiple times (whether within the same MLB file or different MLB files) will =
be elaborated and evaluated multiple times.  That's what's happening with "=
src/Unicode/encoding.sml".  Even though it has a transparent signature matc=
h, its "datatype" declaration is generative, so the "Encoding.Encoding" typ=
e in "parser.mlb" is different from the "Encoding.Encoding" type in "encode=
.mlb".  To fix the error, you would want to introduce a "src/Unicode/encodi=
ng.mlb" file that contains the only reference to "src/Unicode/encoding.sml"=
 and change the other references to "src/Unicode/encoding.sml" in other .ml=
b files to references to "src/Unicode/encoding.mlb".

-Matthew

On Tue, Oct 30, 2018 at 7:22 AM <[email protected]<mailto:Mic=
[email protected]>> wrote:
Ha, it=E2=80=99s possible you saw my fork of Chris=E2=80=99s repo rather th=
an my original (I just dumped what wasn=E2=80=99t working and switched to h=
is in the same place).  I=E2=80=99ve put the breaking repo at

  https://github.com/mn200/fxp145

if you=E2=80=99re interested.

I was disturbed by the fact that the =E2=80=9Csame=E2=80=9D sequence of fil=
es fed to Poly/ML didn=E2=80=99t lead to any complaints.

Best,
Michael

From: Matthew Fluet <[email protected]<mailto:[email protected]=
>>
Reply-To: "[email protected]<mailto:[email protected]>" <mlton-user@m=
lton.org<mailto:[email protected]>>
Date: Tuesday, 30 October 2018 at 21:31
To: MLton users <[email protected]<mailto:[email protected]>>
Cc: "[email protected]<mailto:[email protected]=
et>" <[email protected]<mailto:[email protected].=
net>>
Subject: Re: [MLton-user] Failing to get FXP to work in mlton

Michael,
I couldn't recreate your type error with your fxp repo.  Compiling `src/App=
s/Copy/copy.mlb` succeeded without error.  That said, the error that you qu=
oted looks like a missing `sharing` or `where` constraint.
-Matthew

On Tue, Oct 30, 2018 at 5:45 AM Chris Cannam <[email protected]<=
mailto:[email protected]>> wrote:


On Mon, 29 Oct 2018, at 22:58, [email protected]<mailto:Micha=
[email protected]> wrote:
> That's great, thanks!  You have a better version of the underlying code
> too (2.0 vs 1.4.5).
>
> As for my compilation error, I tried to create one .mlb file per
> directory (more or less), whereas I see you put every core .sml file
> into the one fxplib.mlb file.

Although I made a few fixes locally, most of the changes are from Timothy B=
ourke's patches at http://www.tbrk.org/software/sml-fxp.html - I just could=
n't find an existing repo that tracked them. (Although I did say this in th=
e commit log, I should probably also update the README to mention it... and=
 also to update the build instructions.)


Chris


_______________________________________________
MLton-user mailing list
[email protected]<mailto:[email protected]>; =
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/mlton-user
--
You received this message because you are subscribed to the Google Groups "=
MLton-user" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected]<mailto:mlton-user+unsubscribe@mlto=
n.org>.
_______________________________________________
MLton-user mailing list
[email protected]<mailto:[email protected]>; =
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/mlton-user
--
You received this message because you are subscribed to the Google Groups "=
MLton-user" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected]<mailto:mlton-user+unsubscribe@mlto=
n.org>.

--=20
You received this message because you are subscribed to the Google Groups "=
MLton-user" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].

--_000_5118B4BFE38D48B8A9DB84D910973169data61csiroau_
Content-Type: text/html; charset="UTF-8"
Content-ID: <[email protected]>
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
<meta name=3D"Generator" content=3D"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: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.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.EmailStyle19
	{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>
</head>
<body lang=3D"EN-AU" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-GB">Thank you very much for the exp=
lanation!&nbsp; That makes sense.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">Michael<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal"><b><span style=3D"font-size:12.0pt;color:black">From=
: </span></b><span style=3D"font-size:12.0pt;color:black">Matthew Fluet &lt=
;[email protected]&gt;<br>
<b>Reply-To: </b>&quot;[email protected]&quot; &lt;[email protected]&=
gt;<br>
<b>Date: </b>Wednesday, 31 October 2018 at 12:15<br>
<b>To: </b>MLton users &lt;[email protected]&gt;<br>
<b>Subject: </b>Re: [MLton-user] Failing to get FXP to work in mlton<o:p></=
o:p></span></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:18.0pt;font-family:&quot;Co=
urier New&quot;">Michael,<o:p></o:p></span></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:18.0pt;font-family:&quot;Co=
urier New&quot;">The type error in your breaking repo is due to the fact th=
at both &quot;src/Parser/parser.mlb&quot; and &quot;src/Unicode/Encode/enco=
de.mlb&quot; reference &quot;src/Unicode/encoding.sml&quot;.&nbsp; There is=
 significant
 difference between referring to a .sml file and to a .mlb file within a .m=
lb file.&nbsp; From&nbsp;<a href=3D"http://mlton.org/MLBasisSyntaxAndSemant=
ics">http://mlton.org/MLBasisSyntaxAndSemantics</a>: &quot;</span><span sty=
le=3D"font-size:13.5pt;font-family:&quot;Courier New&quot;">A
 reference to an SML source file causes the file to be elaborated in the ba=
sis extant at the point of reference. A reference to an MLB file causes the=
 basis denoted by that MLB file to be imported</span><span style=3D"font-si=
ze:13.5pt;font-family:&quot;Cambria Math&quot;,serif">=E2=80=89</span><span=
 style=3D"font-size:13.5pt;font-family:&quot;Courier New&quot;">
 =E2=80=94 </span><span style=3D"font-size:13.5pt;font-family:&quot;Cambria=
 Math&quot;,serif">=E2=80=89</span><span style=3D"font-size:13.5pt;font-fam=
ily:&quot;Courier New&quot;">the basis at the point of reference does not a=
ffect the imported basis. ... A</span><span style=3D"font-size:18.0pt;font-=
family:&quot;Courier New&quot;">n
 MLB file is elaborated starting in an empty basis. Each MLB file is elabor=
ated and evaluated only once, with the result being cached. Subsequent refe=
rences use the cached value. Thus, any observable effects due to evaluation=
 are not duplicated if the MLB file
 is referred to multiple times.&quot;&nbsp; In contrast, an SML source file=
 that is referred to multiple times (whether within the same MLB file or di=
fferent MLB files) will be elaborated and evaluated multiple times.&nbsp; T=
hat's what's happening with &quot;src/Unicode/encoding.sml&quot;.&nbsp;
 Even though it has a transparent signature match, its &quot;datatype&quot;=
 declaration is generative, so the &quot;Encoding.Encoding&quot; type in &q=
uot;parser.mlb&quot; is different from the &quot;Encoding.Encoding&quot; ty=
pe in &quot;encode.mlb&quot;.&nbsp; To fix the error, you would want to int=
roduce a &quot;src/Unicode/encoding.mlb&quot;
 file that contains the only reference to &quot;src/Unicode/encoding.sml&qu=
ot; and change the other references to &quot;src/Unicode/encoding.sml&quot;=
 in other .mlb files to references to &quot;src/Unicode/encoding.mlb&quot;.=
</span><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:18.0pt;font-family:&quot;Co=
urier New&quot;">-Matthew</span><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class=3D"MsoNormal">On Tue, Oct 30, 2018 at 7:22 AM &lt;<a href=3D"mailt=
o:[email protected]">[email protected]</a>&gt; =
wrote:<o:p></o:p></p>
</div>
<blockquote style=3D"border:none;border-left:solid #CCCCCC 1.0pt;padding:0c=
m 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">Ha, it=E2=80=99s possible you saw my fork of =
Chris=E2=80=99s repo rather than my original (I just dumped what wasn=E2=80=
=99t working and switched to his in the same place).&nbsp; I=E2=80=99ve put
 the breaking repo at</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">&nbsp;</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">&nbsp;
<a href=3D"https://github.com/mn200/fxp145" target=3D"_blank">https://githu=
b.com/mn200/fxp145</a></span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">&nbsp;</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">if you=E2=80=99re interested.
</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">&nbsp;</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">I was disturbed by the fact that the =E2=80=
=9Csame=E2=80=9D sequence of files fed to Poly/ML didn=E2=80=99t lead to an=
y complaints.</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">&nbsp;</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">Best,</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">Michael</span><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span lang=3D"EN-GB">&nbsp;</span><o:p></o:p></p>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><b><span style=3D"font-size:12.0pt;color:black">From:
</span></b><span style=3D"font-size:12.0pt;color:black">Matthew Fluet &lt;<=
a href=3D"mailto:[email protected]" target=3D"_blank">matthew.fluet@g=
mail.com</a>&gt;<br>
<b>Reply-To: </b>&quot;<a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a>&quot; &lt;<a href=3D"mailto:mlton-user@mlton=
.org" target=3D"_blank">[email protected]</a>&gt;<br>
<b>Date: </b>Tuesday, 30 October 2018 at 21:31<br>
<b>To: </b>MLton users &lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;<br>
<b>Cc: </b>&quot;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&quot; &lt;<a href=3D"mailt=
o:[email protected]" target=3D"_blank">[email protected]=
ceforge.net</a>&gt;<br>
<b>Subject: </b>Re: [MLton-user] Failing to get FXP to work in mlton</span>=
<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
</div>
<div>
<div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span style=3D"font-size:18.0pt;font-family:&quot;Courier New&quot=
;">Michael,</span><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span style=3D"font-size:18.0pt;font-family:&quot;Courier New&quot=
;">I couldn't recreate your type error with your fxp repo.&nbsp; Compiling =
`src/Apps/Copy/copy.mlb` succeeded without error.&nbsp; That
 said, the error that you quoted looks like a missing `sharing` or `where` =
constraint.</span><o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span style=3D"font-size:18.0pt;font-family:&quot;Courier New&quot=
;">-Matthew</span><o:p></o:p></p>
</div>
</div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">&nbsp;<o:p></o:p></p>
<div>
<div>
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">On Tue, Oct 30, 2018 at 5:45 AM Chris Cannam &lt;<a href=3D"mailto=
:[email protected]" target=3D"_blank">[email protected]=
om</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style=3D"border:none;border-left:solid #CCCCCC 1.0pt;padding:0c=
m 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-=
bottom:5.0pt">
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><br>
<br>
On Mon, 29 Oct 2018, at 22:58, <a href=3D"mailto:[email protected]=
ro.au" target=3D"_blank">
[email protected]</a> wrote:<br>
&gt; That's great, thanks!&nbsp; You have a better version of the underlyin=
g code <br>
&gt; too (2.0 vs 1.4.5).<br>
&gt; <br>
&gt; As for my compilation error, I tried to create one .mlb file per <br>
&gt; directory (more or less), whereas I see you put every core .sml file <=
br>
&gt; into the one fxplib.mlb file.<br>
<br>
Although I made a few fixes locally, most of the changes are from Timothy B=
ourke's patches at
<a href=3D"http://www.tbrk.org/software/sml-fxp.html" target=3D"_blank">htt=
p://www.tbrk.org/software/sml-fxp.html</a> - I just couldn't find an existi=
ng repo that tracked them. (Although I did say this in the commit log, I sh=
ould probably also update the README
 to mention it... and also to update the build instructions.)<br>
<br>
<br>
Chris<br>
<br>
<br>
_______________________________________________<br>
MLton-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">MLton=
[email protected]</a>;
<a href=3D"mailto:[email protected]" target=3D"_blank">mlton-user@mlton.=
org</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/mlton-user" target=
=3D"_blank">https://lists.sourceforge.net/lists/listinfo/mlton-user</a><o:p=
></o:p></p>
</blockquote>
</div>
</div>
</div>
<p class=3D"MsoNormal">-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;MLton-user&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to
<a href=3D"mailto:mlton-user&#43;[email protected]" target=3D"_blank">m=
lton-user&#43;[email protected]</a>.<br>
_______________________________________________<br>
MLton-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">MLton=
[email protected]</a>;
<a href=3D"mailto:[email protected]" target=3D"_blank">mlton-user@mlton.=
org</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/mlton-user" target=
=3D"_blank">https://lists.sourceforge.net/lists/listinfo/mlton-user</a><o:p=
></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
<p class=3D"MsoNormal">-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;MLton-user&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to
<a href=3D"mailto:mlton-user&#43;[email protected]">mlton-user&#43;unsu=
[email protected]</a>.<br>
<br>
<o:p></o:p></p>
</div>
</body>
</html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;MLton-user&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">mlton-user+unsu=
[email protected]</a>.<br />

--_000_5118B4BFE38D48B8A9DB84D910973169data61csiroau_--


--===============3240063795488384858==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============3240063795488384858==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
MLton-user mailing list
[email protected]; [email protected]
https://lists.sourceforge.net/lists/listinfo/mlton-user

--===============3240063795488384858==--