<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>I also worked under the relaxed interpretation, and it is
surprising to me that GHC does better.<br>
<br>
if GHC will do even better, I'd try to first formulate what that
better is.<br>
<br>
"a local binding group is closed if all variables free in the
group are bound at top-level" is somewhat understandable, adding
further exceptions makes more programs to type-check, but if
specifications becomes more cumbersome verifying that
implementations does what specification advertises becomes more
difficult.<br>
<br>
The "the variable has an explicit type signature that has no free
type variables" additions seems arbitrary, it's not motivated in
the manual. How much of the "real code" will break if it is
removed?<br>
<br>
- Oleg<br>
</p>
<div class="moz-cite-prefix">On 11.2.2021 17.03, Richard Eisenberg
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:010f0177919e5c8b-77f90d31-af7f-4e01-9125-b3e9ce434cc1-000000@us-east-2.amazonses.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 11, 2021, at 9:23 AM, Tom Ellis <<a
href="mailto:tom-lists-haskell-cafe-2017@jaguarpaw.co.uk"
class="" moz-do-not-send="true">tom-lists-haskell-cafe-2017@jaguarpaw.co.uk</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="caret-color: rgb(0, 0, 0);
font-family: Menlo-Regular; font-size: 11px; font-style:
normal; font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class=""> "In pFG, the argument pBArg has
been given a type (moreover a</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class=""> monomorphic type) by the type
signature for pFG itself. Why does</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class=""> the definition of 'closed' require
the variable to be let-bound?</span><br
style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class=""> Wouldn't lambda-bound with a type
implicitly provided by an</span><br style="caret-color:
rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 11px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration: none;"
class="">
<span style="caret-color: rgb(0, 0, 0); font-family:
Menlo-Regular; font-size: 11px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; text-align: start; text-indent:
0px; text-transform: none; white-space: normal;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration: none; float: none; display: inline
!important;" class=""> explicit type signature for the
lambda" be equally good?"</span></div>
</blockquote>
</div>
<br class="">
<div class="">I think so, yes.</div>
<div class=""><br class="">
</div>
<div class="">Full disclosure: before this thread, I had never
looked closely at the MonoLocalBinds definition. For years, I
was operating under a simpler premise: "a local binding group is
closed if all variables free in the group are bound at
top-level". That is, any binding group that capture variables
from the local definition would not be generalized. This
interpretation means that your definition within pFG1 would also
not be generalized. But my working definition was too limited,
as the manual explains.</div>
<div class=""><br class="">
</div>
<div class="">Bottom line: I think you're right that we could do
more generalization. I'm not sure how easy this would be to
implement (I don't know how GHC tracks this information off the
top of my head), but I do think it's worth filing a ticket to
see if we can easily do better.</div>
<div class=""><br class="">
</div>
<div class="">Good conversation! I've learned something here.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Richard</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</pre>
</blockquote>
</body>
</html>