<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Looks good, thanks!<br><br><div dir="ltr">--<div>festina lente</div><div><br></div></div><div dir="ltr"><br><blockquote type="cite">On 16 Jun 2021, at 16:42, Krukoff, John <John.Krukoff@tiaa.org> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.BlockQuote, li.BlockQuote, div.BlockQuote
{mso-style-name:"Block Quote";
mso-style-link:"Block Quote Char";
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
font-style:italic;}
span.BlockQuoteChar
{mso-style-name:"Block Quote Char";
mso-style-link:"Block Quote";
font-family:"Calibri",sans-serif;
font-style:italic;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">FWIW,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I also gave this a try a while a back, and tried to create a version that was easier to use at the expense of more complexity on the lens construction.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><a href="https://github.com/jkrukoff/optic">https://github.com/jkrukoff/optic</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I found the complexity of lens composition to be a bit painful without a strict type checker, so took a slightly different approach for an Erlang library. The
above library includes ready made modules for all the stdlib data types.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">John K.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> erlang-questions <erlang-questions-bounces@erlang.org>
<b>On Behalf Of </b>Ivan Uemlianin<br>
<b>Sent:</b> Wednesday, June 16, 2021 1:11 AM<br>
<b>To:</b> erlang-questions@erlang.org<br>
<b>Subject:</b> Re: The feature to find the value inside the nested map.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Agree. Haskellers call them lenses.<br>
<br>
There was a discussion about them here a few years ago:<br>
<br>
<a href="http://erlang.org/pipermail/erlang-questions/2015-November/086879.html">
http://erlang.org/pipermail/erlang-questions/2015-November/086879.html</a><br>
<br>
And there have been a few implementation attempts:<br>
<br>
2020 <a href="https://github.com/slepher/lenses">https://github.com/slepher/lenses</a><br>
2015 <a href="https://www.cs.otago.ac.nz/staffpriv/ok/lens.erl">https://www.cs.otago.ac.nz/staffpriv/ok/lens.erl</a><br>
2012 <a href="https://github.com/jlouis/erl-lenses">https://github.com/jlouis/erl-lenses</a><br>
<br>
Best wishes<br>
<br>
Ivan<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 16/06/2021 03:04, <span style="font-family:"MS Gothic"">瀬川昂弘</span> wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<p class="MsoNormal">Assuming,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Map = <span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">#{a => b,c => #{1 => 2,3 => 4,5 => #{x => y}}}.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">Expected:</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black"><a href="maps:new_find_fun(Key">maps:new_find_fun(Key</a> = 5, Map) = {ok,#{x => y}}.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black">It's useful there is the above feature, in my guess.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Takahiro Segawa.<br>
E-mail<span style="font-family:"MS Gothic"">:</span><a href="mailto:123430024@ccalumni.meijo-u.ac.jp" target="_blank">123430024@ccalumni.meijo-u.ac.jp</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>============================================================<o:p></o:p></pre>
<pre>Ivan A. Uemlianin PhD<o:p></o:p></pre>
<pre>Llaisdy<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Ymchwil a Datblygu Technoleg Lleferydd<o:p></o:p></pre>
<pre>Speech Technology Research and Development<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> <a href="mailto:ivan@llaisdy.com">ivan@llaisdy.com</a><o:p></o:p></pre>
<pre> @llaisdy<o:p></o:p></pre>
<pre> llaisdy.wordpress.com<o:p></o:p></pre>
<pre> github.com/llaisdy<o:p></o:p></pre>
<pre> <a href="http://www.linkedin.com/in/ivanuemlianin">www.linkedin.com/in/ivanuemlianin</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> festina lente<o:p></o:p></pre>
<pre>============================================================<o:p></o:p></pre>
</div>
<p><br>
*************************************************************************<br>
This e-mail may contain confidential or privileged information.<br>
If you are not the intended recipient, please notify the sender immediately and then delete it.</p>
<p>TIAA<br>
*************************************************************************</p>
</div></blockquote></body></html>