<div dir="ltr">







Hi all,<br><br>I had a quick idea about record field syntax as specified in the GSoC project plan: <a href="http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan">http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan</a>.<div>

<br></div><div>Instead of &quot;f.x&quot; (to access field x of record f), maybe we could write &quot;f{x}&quot; as the record selection.  That is, we&#39;d reuse the brace notation which is already in place for record updates.  Unlike dot notation, this is unambiguous and doesn&#39;t conflict with any existing syntax (AFAIK).  It would also generalize to &quot;f{x}{y}{z}&quot; instead of &quot;f.x.y.z&quot;.<br>

<br>This proposal would add two new forms of expressions:<br><br>f{x} to access field x of data f<br>({x}) = \f -&gt; f{x} as a field access section<br><br>Additionally, it seems like record mutation expressions could also have sections:<br>

<br>({x=2}) = \f -&gt; f{x=2}<br><br>That actually seems useful by itself, regardless of whether we use dot notation for field access.<br><br>Best,<br>-Judah</div></div>