<div dir="ltr">indeed, this relates / augments record puns syntax already in GHC <a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#record-puns">http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#record-puns</a>.<div>
<br></div><div style>Otoh, would there be any ambiguity wrt applying functions to blocks?</div><div style><br></div><div style><br></div><div style>eg </div><div style>f = (+ 1)</div><div style>h= f {let x = 7 in 3*x},</div>
<div style>would that trip up the syntax?</div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 30, 2013 at 2:59 AM, Judah Jacobson <span dir="ltr"><<a href="mailto:judah.jacobson@gmail.com" target="_blank">judah.jacobson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan</a>.<div>
<br></div><div>Instead of "f.x" (to access field x of record f), maybe we could write "f{x}" as the record selection. That is, we'd reuse the brace notation which is already in place for record updates. Unlike dot notation, this is unambiguous and doesn't conflict with any existing syntax (AFAIK). It would also generalize to "f{x}{y}{z}" instead of "f.x.y.z".<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 -> 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 -> 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>
<br>_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">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><br>
<br></blockquote></div><br></div>