[erlang-questions] Updates, lenses, and why cross-module inlining would be nice

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Fri Nov 27 12:22:38 CET 2015


On Fri, Nov 27, 2015 at 4:42 AM, Richard A. O'Keefe <ok@REDACTED>
wrote:

> defines as lens as a triple {Get,Put,Update}.


This! Richard's implementation is better for numerous reasons, among which
is that it provides an optimized Update-operation. When developing the
logic, it is nice to say "Update is really just an application of the
identity put(Lens, Data, Fun(get(Lens, Data))" because those kind of
observations tend to shorten proofs. In practice however, there are often a
speedup to be gained by recognizing code often has a nice way to
"update-in-place" when a target element is found.


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151127/9c1970b0/attachment.htm>


More information about the erlang-questions mailing list