The fact that they suppress unused identifier warnings is a more of burden on me the implementor of lens more than on users of lens as the only names we generate with _&#39;s in them are for prisms.<div><br></div><div>And we exploit the fact that unused names that start with _&#39;s don&#39;t give warnings, so that users who don&#39;t export the non-lens-based field accessors from their functions don&#39;t get complained at by the compiler.</div>
<div><br></div><div>The adoption of _Constructor for prisms though it can lead to unexported prisms has the benefit of being unobtrusive and taking up namespace that literally nobody was using in the entire ecosystem, letting us avoid qualified import hell. Not everyone is so sanguine about qualifying every import in their program. ;)</div>
<div><br></div><div>The convention was very uncomfortable for me at first, too, for the same reason it makes you unhappy, but all of alternatives take up names other people are using, collide between lenses and prisms, and are more verbose.</div>
<div><br></div><div>-Edward</div><div><br><div class="gmail_quote">On Fri, Aug 9, 2013 at 12:00 PM, Henning Thielemann <span dir="ltr">&lt;<a href="mailto:schlepptop@henning-thielemann.de" target="_blank">schlepptop@henning-thielemann.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 09.08.2013 17:31, schrieb Dan Doel:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here&#39;s another smart-ass remark, then: use lens and bifunctors. They<br>
have great abstractions for these.<br>
<br>
mapEither and mapPair are just two specializations of bimap. It also<br>
has first and second which generalize mapFst, etc. And by the way,<br>
everyone here (I think) has missed that you can also traverse these<br>
things, but bifunctors also has that covered, with bitraverse.<br>
<br>
The individual parts are applications of lenses, too. over _1 and over<br>
_2 are mapFst and mapSnd. _1 and _2 function as traverseFst and<br>
traverseSnd.<br>
</blockquote>
<br>
<br></div>
These generalizations seem to be more natural to me than Control.Arrow.<br>
<br>
<br>
(However, identifiers with leading underscore are a bad idea, since they suppress &quot;unused identifier&quot; warnings in GHC. But I think I complained about that before.)<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>