<p dir="ltr">+= carries expectation of specific behavioural properties in popular circles, making it a devious moniker. In an attempt to bridge programming paradigms with Haskell this problem is common.  There be dragons here: Always question your assumptions about familiar names and symbols. </p>

<div class="gmail_quote">On 2013-05-24 11:15 AM, &quot;Brent Yorgey&quot; &lt;<a href="mailto:byorgey@seas.upenn.edu">byorgey@seas.upenn.edu</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, May 24, 2013 at 06:41:27PM +0200, Giacomo Tesio wrote:<br>
&gt; For example I&#39;m scared by += a function compositions.<br>
&gt;<br>
&gt; For example here<br>
&gt;<br>
&gt; units.traversed.health -= 3<br>
&gt;<br>
&gt;<br>
&gt; (from<br>
&gt; <a href="http://www.haskellforall.com/2013/05/program-imperatively-using-haskell.html" target="_blank">http://www.haskellforall.com/2013/05/program-imperatively-using-haskell.html</a>)<br>
&gt; I&#39;ve some difficult to grasp the type. I can calculate it (or ask ghci :-D)<br>
&gt; , but it looks complex to grasp.<br>
&gt;<br>
&gt; May be I&#39;m just too new to Haskell tools... but... I fear that in the long<br>
&gt; run, this could become unreadable.<br>
<br>
You could already do exactly the same thing without the lens package.<br>
It uses the State monad.  The lens package just makes it much simpler<br>
to write this code.<br>
<br>
If you think that overuse of the State monad will lead to bad,<br>
unmaintainable code, you are right.  But that has nothing to do with<br>
lenses.<br>
<br>
Lenses can also be used in many contexts which do not involve the<br>
State monad.<br>
<br>
-Brent<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div>