<div>The semantics of Frege&#39;s records are layed out in its manual [1] in the following sections:</div><div><div>4.2.1 Algebraic Data type Declaration - Constructors with labeled fields</div></div><div>3.2 Primary Expression</div>

<div><br></div><div>The Frege record system explanation is the first one that I could read and immediately understand (oh, it just creates a namespace!). Perhaps this is just in part because it was better explained. But I think it is also because desugaring records to a library is a very complicated proposition, whereas taking the same library concept but baking it into the compiler and making simple language modifications is actually much more straightforward to understand.</div>

<div><br></div><div>Many of the built-in record proposals seem more ambitious (create a new record from an existing one, generalize in some other direction). More power or generalization could be very useful, but it can wait for later - Haskell&#39;s records are glaringly bad because they lack name-spacing.</div>

<div><br></div><div>I think one of the problems being faced with improving records is a false choice between a quick but hacky library desugaring or a major &quot;Extensible&quot; records built into the compiler. What I am proposing is that (unless someone proposes a great desugaring solution) we make it the immediate goal to have records built into the compiler, but done in the simplest (perhaps least &quot;Extensible&quot;) way that just accomplishes name-spacing.</div>

<div><br></div><div>[1] <a href="http://code.google.com/p/frege/downloads/detail?name=Language-202.pdf">http://code.google.com/p/frege/downloads/detail?name=Language-202.pdf</a><br><br><div class="gmail_quote">On Tue, Dec 27, 2011 at 8:32 AM, Greg Weber <span dir="ltr">&lt;<a href="mailto:greg@gregweber.info">greg@gregweber.info</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The original goal was to come up with a simple solution. Perhaps that goal is unattainable, or at least attaining it has much higher cost than we had hoped. If that is the case we must take a step back and look at changing how things are done currently. Perhaps the approach that a record label becomes a global module function is just not feasible.<div>


<p>In the <a href="http://code.google.com/p/frege" target="_blank">Frege</a> (a Haskell with some differences implementation on the JVM) language every data type is at the same time a namespace.</p><p style="text-align:left">

* the function that accesses field x of data type T is T.x</p>
<p style="text-align:left">* If a::T then a.x = T.x a</p><p style="text-align:left">* the function that updates field x of data type T is T.{x=}</p><p style="text-align:left">* the function that sets field x in a T to 42 is T.{x=42}</p>


<p style="text-align:left">* If a::T then a.{x=} and a.{x=42} are valid</p><p style="text-align:left">* the function that changes field x of a T by applying some function to it is T.{x &lt;-}</p><p style="text-align:left">


* T.{x?} is a function that returns true iff the argument was constructed with a data constructor that has field x.</p><div>In the Opa language a Module is in fact a Record specially marked as a module.</div><div><br></div>


<div>What do you think of the Frege system?</div><div><div></div><div class="h5"><br><div class="gmail_quote">On Fri, Dec 23, 2011 at 2:40 PM, Greg Weber <span dir="ltr">&lt;<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am willing to help on this as much as I can. Unfortunately I don&#39;t think you want me to lead the discussion or make decisions on this - many of these discussions seem over my head. I will continue to study them though and see if the sink in more.<div>



<br></div><div>I do think almost all of these proposals want a dot selector, so it is a good idea for Haskell to require the normal function (composition) dot to have spaces around it - should this be brought to the Haskell Prime committee?</div>



<div><br></div><div><font color="#888888">Greg Weber</font><div><div></div><div><br><br><div class="gmail_quote">On Fri, Dec 23, 2011 at 1:52 PM, Simon Peyton-Jones <span dir="ltr">&lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div><div>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:14.0pt">Are Records stalled out again? I am perfectly willing to leave the fate of records up to a willing and capable implementer. That seems much better than waiting another 5 years for
 perfection :)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
</div><p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Yes, they are stalled again.  The “simple solution” turned out to be not simple.  I wrote it up at length in
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">           
<a href="http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields" target="_blank">
http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">There are various unsatisfactory aspects of the proposal, particularly concerning record update.  I am not sure how to resolve them.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">There was essentially no reaction.  As it’s quite a lot of work to implement, and no one seemed to care very much, I put it back on the back burner.   So that’s
 where it stands.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Meanwhile, AntC has put forth another proposal that I have not had time to look at in detail.<u></u><u></u></span></p>




<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><a href="http://www.haskell.org/pipermail/glasgow-haskell-users/2011-December/021298.html" target="_blank">http://www.haskell.org/pipermail/glasgow-haskell-users/2011-December/021298.html</a><u></u><u></u></span></p>




<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">What this needs is someone (not me) to lead the discussion and try to make sure it makes progress</span></b><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">. 
 For example, does AntC’s proposal work? Is it better than the one I articulated?  Are any other variants worth considering? Is the gain from overloading record fields worth the pain or design and implementation?    Volunteers, stand forth!<u></u><u></u></span></p>




<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></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 #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Greg Weber [mailto:<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>]
<br>
<b>Sent:</b> 09 December 2011 19:38<br>
<b>To:</b> Simon Peyton-Jones<br>
<b>Cc:</b> Wolfgang Jeltsch; <a href="mailto:glasgow-haskell-users@haskell.org" target="_blank">glasgow-haskell-users@haskell.org</a></span></p><div><br>
<b>Subject:</b> Re: Records in Haskell<u></u><u></u></div><p></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Are Records stalled out again? I am perfectly willing to leave the fate of records up to a willing and capable implementer. That seems much better than waiting another 5 years for perfection :)<u></u><u></u></p>



<div><div></div><div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">As an intermediate step, is it possible to put a warning in 7.4 when the dot operator is used without a space so that it can be reserved for usage with a records solution? Or will the new records solution be turned on by an extension anyways?<u></u><u></u></p>




<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Mon, Nov 7, 2011 at 10:21 AM, Simon Peyton-Jones &lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt; wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">| would inclusion of such a record system into GHC mean that plans for<br>
| first-class labels (&lt;<a href="http://tinyurl.com/7fppj32" target="_blank">http://tinyurl.com/7fppj32</a>&gt;) are abandoned? That<br>
| would be a pity, since first-class labels are very useful to implement<br>
| record systems that go beyond what the abovementioned record system<br>
| provides. See, for example, my work on records:<br>
|      &lt;<a href="http://www.informatik.tu-cottbus.de/~jeltsch/research/ppdp-2010-paper.pdf" target="_blank">http://www.informatik.tu-cottbus.de/~jeltsch/research/ppdp-2010-paper.pdf</a>&gt;<br>
|      &lt;<a href="http://hackage.haskell.org/package/records" target="_blank">http://hackage.haskell.org/package/records</a>&gt;<u></u><u></u></p>
</div>
<p class="MsoNormal">The story is summarised at<br>
       <a href="http://hackage.haskell.org/trac/ghc/wiki/Records" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/Records</a><br>
<br>
First-class labels are one point in the vast swamp of competing and overlapping proposals for records.  I think they are summarise here:<br>
       <a href="http://hackage.haskell.org/trac/ghc/wiki/ExtensibleRecords" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/ExtensibleRecords</a><br>
I am unsure which of this list of proposals you are referring to. The URL you quote is this<br>
       <a href="http://hackage.haskell.org/trac/haskell-prime/wiki/FirstClassLabels" target="_blank">http://hackage.haskell.org/trac/haskell-prime/wiki/FirstClassLabels</a><br>
but it doesn&#39;t seem to actually contain a design, merely some options for a design that is implicit.  If you do have a design you advocate, it would be good to add it to the list at<br>
       <a href="http://hackage.haskell.org/trac/ghc/wiki/ExtensibleRecords" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/ExtensibleRecords</a><br>
perhaps explaining which of the other members of the list it subsumes.<br>
<br>
Because there are so many proposals I have not gone ahead with any of them.  The most recent thread, articulated at<br>
       <a href="http://hackage.haskell.org/trac/ghc/wiki/Records" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/Records</a><br>
is to ask what is the *smallest change* that would solve the *most pressing problem*, namely the inability to use the same field name in different records.  First class labels is (I assume) much more ambitious.  But maybe not.<br>




<br>
Anything you can do to bring clarity to the swamp, by editing the above two pages, would be a great service to the community.  At the moment, we are stuck in an infinite loop.<br>
<span style="color:#888888"><br>
Simon</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org" target="_blank">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>