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! That makes sense.<o:p></o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p> </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> </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 <= ;[email protected]><br> <b>Reply-To: </b>"[email protected]" <[email protected]&= gt;<br> <b>Date: </b>Wednesday, 31 October 2018 at 12:15<br> <b>To: </b>MLton users <[email protected]><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> </o:p></p> </div> <div> <div> <div> <div> <p class=3D"MsoNormal"><span style=3D"font-size:18.0pt;font-family:"Co= urier New"">Michael,<o:p></o:p></span></p> </div> <div> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> <div> <p class=3D"MsoNormal"><span style=3D"font-size:18.0pt;font-family:"Co= urier New"">The type error in your breaking repo is due to the fact th= at both "src/Parser/parser.mlb" and "src/Unicode/Encode/enco= de.mlb" reference "src/Unicode/encoding.sml". There is= significant difference between referring to a .sml file and to a .mlb file within a .m= lb file. From <a href=3D"http://mlton.org/MLBasisSyntaxAndSemant= ics">http://mlton.org/MLBasisSyntaxAndSemantics</a>: "</span><span sty= le=3D"font-size:13.5pt;font-family:"Courier New"">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:"Cambria Math",serif">=E2=80=89</span><span= style=3D"font-size:13.5pt;font-family:"Courier New""> =E2=80=94 </span><span style=3D"font-size:13.5pt;font-family:"Cambria= Math",serif">=E2=80=89</span><span style=3D"font-size:13.5pt;font-fam= ily:"Courier New"">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:"Courier New"">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." 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. T= hat's what's happening with "src/Unicode/encoding.sml". Even though it has a transparent signature match, its "datatype"= declaration is generative, so the "Encoding.Encoding" type in &q= uot;parser.mlb" is different from the "Encoding.Encoding" ty= pe in "encode.mlb". To fix the error, you would want to int= roduce a "src/Unicode/encoding.mlb" file that contains the only reference to "src/Unicode/encoding.sml&qu= ot; and change the other references to "src/Unicode/encoding.sml"= in other .mlb files to references to "src/Unicode/encoding.mlb".= </span><o:p></o:p></p> </div> <div> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> <div> <p class=3D"MsoNormal"><span style=3D"font-size:18.0pt;font-family:"Co= urier New"">-Matthew</span><o:p></o:p></p> </div> <div> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> <div> <div> <p class=3D"MsoNormal">On Tue, Oct 30, 2018 at 7:22 AM <<a href=3D"mailt= o:[email protected]">[email protected]</a>> = 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). 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"> </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"> <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"> </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"> </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"> </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"> </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 <<= a href=3D"mailto:[email protected]" target=3D"_blank">matthew.fluet@g= mail.com</a>><br> <b>Reply-To: </b>"<a href=3D"mailto:[email protected]" target=3D"_b= lank">[email protected]</a>" <<a href=3D"mailto:mlton-user@mlton= .org" target=3D"_blank">[email protected]</a>><br> <b>Date: </b>Tuesday, 30 October 2018 at 21:31<br> <b>To: </b>MLton users <<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>><br> <b>Cc: </b>"<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>" <<a href=3D"mailt= o:[email protected]" target=3D"_blank">[email protected]= ceforge.net</a>><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"> <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:"Courier New"= ;">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:"Courier New"= ;">I couldn't recreate your type error with your fxp repo. Compiling = `src/Apps/Copy/copy.mlb` succeeded without error. 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:"Courier New"= ;">-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"> <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 <<a href=3D"mailto= :[email protected]" target=3D"_blank">[email protected]= om</a>> 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> > That's great, thanks! You have a better version of the underlyin= g code <br> > too (2.0 vs 1.4.5).<br> > <br> > As for my compilation error, I tried to create one .mlb file per <br> > directory (more or less), whereas I see you put every core .sml file <= br> > 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" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:mlton-user+[email protected]" target=3D"_blank">m= lton-user+[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" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:mlton-user+[email protected]">mlton-user+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" 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==--