<div dir="ltr">2011/9/6 Poprádi Árpád <span dir="ltr">&lt;<a href="mailto:popradi_arpad@freemail.hu">popradi_arpad@freemail.hu</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
updateData1 :: X -&gt; MonadicEnv()<br>
updateData1 d = do; env &lt;- get; put env {data1 = d}<br></blockquote><div><br></div><div>&gt; updateData1 d = modify (\r -&gt; r {data1 = d})</div><div><br></div><div>But there is, sadly, no eta-reduced version of record update to make the &quot;\r -&gt; r ...&quot; boilerplate go away; recognition of the syntax requires an expression before the braces.  (Consider the ambiguity of the eta-reduced expression &quot;modify {data1 = d}&quot;.)  Also, and much more annoyingly, &quot;data1&quot; must be constant.</div>
<div><br></div><div>If you can decipher the documentation, there are several alternative record packages on Hackage based on functional lenses.  Also there are packages which use Template Haskell to automate the above.</div>
<div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>