<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  modifyConfig :: (Config -&gt; a) -&gt; (a -&gt; a) -&gt; Config -&gt; Config<br>
   modifyConfig fr fv a = a { fr = fv (fr a) <br></blockquote><div><br></div><div>I like this Idea. The only problem I see is this: if I&#39;m trying to write code that is very generic and abstract, how does the compiler know if the update</div>
<div><br>&gt; a { fr = 5 }</div><div><br>is targeting a field fr of the record a, or a variable fr, which is in scope and &quot;points to&quot; a first-class field. The difference depends on the record in question, so the code would work differently depending on the context. I would think it would have to be something like </div>
<div><br>&gt; a { :fr = 5 } </div><div><br>or something else syntactically distinct from current record update syntax.</div><div><br></div><div>With this and a few more conveniences on record syntax, lenses could go away. For example, I&#39;d love to see a &quot;lambda update&quot; syntax. For example instead of:<br>
<br>&gt; setName n r = r {name = n}</div><div><br></div><div>we&#39;d write<br><br>&gt; setName n = \{name = n}<br><br>I&#39;d also like to see an &quot;Update field by&quot; syntax. Instead of <br><br>&gt; addMr r = r { name = &quot;Mr. &quot; ++ (name r) }<br>
<br>we&#39;d write <br><br>&gt; addMr r = r { name =&gt; (&quot;Mr. &quot;++) }<br><br>or combining the previous 2:<br><br>&gt; addMr = \{name=&gt;(&quot;Mr. &quot;++)}</div><div><br></div><div>feels very terse and &quot;Haskelly&quot; to me.</div>
<div><br></div><div>Regards,</div><div><br></div><div>--J Arthur</div><div><br></div><div><br></div></div>