The feature to find the value inside the nested map.

Krukoff, John John.Krukoff@REDACTED
Wed Jun 16 17:42:17 CEST 2021


FWIW,

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.

https://github.com/jkrukoff/optic

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.

Thanks,
John K.

From: erlang-questions <erlang-questions-bounces@REDACTED> On Behalf Of Ivan Uemlianin
Sent: Wednesday, June 16, 2021 1:11 AM
To: erlang-questions@REDACTED
Subject: Re: The feature to find the value inside the nested map.

Agree.  Haskellers call them lenses.

There was a discussion about them here a few years ago:

  http://erlang.org/pipermail/erlang-questions/2015-November/086879.html

And there have been a few implementation attempts:

  2020 https://github.com/slepher/lenses
  2015 https://www.cs.otago.ac.nz/staffpriv/ok/lens.erl
  2012 https://github.com/jlouis/erl-lenses

Best wishes

Ivan

On 16/06/2021 03:04, 瀬川昂弘 wrote:
Assuming,
Map = #{a => b,c => #{1 => 2,3 => 4,5 => #{x => y}}}.

Expected:
maps:new_find_fun(Key = 5, Map) = {ok,#{x => y}}.

It's useful there is the above feature, in my guess.

--
Takahiro Segawa.
E-mail:123430024@REDACTED<mailto:123430024@REDACTED>



--

============================================================

Ivan A. Uemlianin PhD

Llaisdy



Ymchwil a Datblygu Technoleg Lleferydd

Speech Technology Research and Development



                    ivan@REDACTED<mailto:ivan@REDACTED>

                        @llaisdy

                         llaisdy.wordpress.com

              github.com/llaisdy

                     www.linkedin.com/in/ivanuemlianin<http://www.linkedin.com/in/ivanuemlianin>



                        festina lente

============================================================
*************************************************************************
This e-mail may contain confidential or privileged information.
If you are not the intended recipient, please notify the sender immediately and then delete it.

TIAA
*************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210616/c454ed8e/attachment.htm>


More information about the erlang-questions mailing list