View Source maps_in (maps_in v0.2.0)

Module to handle nested maps.

Link to this section Summary

Link to this section Functions

Link to this function

filter(Path, Pred, Map1)

View Source
-spec filter(Path, Pred, Map1) -> Map2
          when
              Path :: [term()],
              Pred :: fun((term(), term()) -> boolean()),
              Map1 :: map(),
              Map2 :: map().
filter/3.
Link to this function

filtermap(Path, Fun, Map1)

View Source
-spec filtermap(Path, Fun, Map1) -> Map2
             when
                 Path :: [term()],
                 Fun :: fun((term(), term()) -> boolean() | {true, term()}),
                 Map1 :: map(),
                 Map2 :: map().
filtermap/3.
-spec find(Key, Path, Map) -> {ok, Value} | error
        when Key :: term(), Path :: [term()], Map :: #{Key => Value, _ => _}.
find/3.
Link to this function

fold(Fun, Init, Path, Map)

View Source
-spec fold(Fun, Init, Path, Map) -> Acc
        when
            Fun :: fun((Key, Value, AccIn) -> AccOut),
            Init :: term(),
            Path :: [term()],
            Acc :: AccOut,
            AccIn :: Init | AccOut,
            Map :: #{Key => Value}.
fold/4.
-spec foreach(Fun, Path, Map) -> ok
           when Fun :: fun((Key, Value) -> term()), Path :: [term()], Map :: #{Key => Value}.
foreach/3.
-spec get(Path, Map) -> Value when Path :: [term()], Map :: map(), Value :: term().
get/2.
-spec get(Path, Map, Default) -> Value | Default
       when Path :: [term()], Map :: map(), Default :: term(), Value :: term().
get/3.
-spec is_key(Key, Path, Map) -> boolean() when Key :: term(), Path :: [term()], Map :: map().
is_key/3.
-spec iterator(Path, Map) -> Iterator when Path :: [term()], Map :: map(), Iterator :: maps:iterator().
iterator/2.
-spec keys(Path, Map) -> Keys when Path :: [term()], Map :: map(), Keys :: [term()].
keys/2.
-spec map(Path, Fun, Map1) -> Map2
       when Path :: [term()], Fun :: fun((term(), term()) -> term()), Map1 :: map(), Map2 :: map().
map/3.
-spec merge(Map1, Path, Map2) -> Map3 when Map1 :: map(), Path :: [term()], Map2 :: map(), Map3 :: map().
merge/3.
Link to this function

merge_with(Combiner, Map1, Path, Map2)

View Source
-spec merge_with(Combiner, Map1, Path, Map2) -> Map3
              when
                  Combiner :: fun((term(), term(), term()) -> term()),
                  Map1 :: map(),
                  Path :: [term()],
                  Map2 :: map(),
                  Map3 :: map().
merge_with/4.
-spec put(Path, Value, Map1) -> Map2
       when Path :: [term()], Value :: term(), Map1 :: map(), Map2 :: map().
put/3.
-spec remove(Key, Path, Map1) -> Map2 when Key :: term(), Path :: [term()], Map1 :: map(), Map2 :: map().
remove/3.
-spec size(Path, Map) -> non_neg_integer() when Path :: [term()], Map :: map().
size/2.
-spec take(Key, Path, Map1) -> {Value, Map2} | error
        when Key :: term(), Path :: [term()], Map1 :: map(), Value :: term(), Map2 :: map().
take/3.
-spec to_list(Path, Map) -> [{Key, Value}] when Path :: [term()], Map :: #{Key => Value}.
to_list/2.
Link to this function

update(Path, Value, Map1)

View Source
-spec update(Path, Value, Map1) -> Map2
          when Path :: [term()], Value :: term(), Map1 :: map(), Map2 :: map().
update/3.
Link to this function

update_with(Path, Fun, Map1)

View Source
-spec update_with(Path, Fun, Map1) -> Map2
               when Path :: [term()], Fun :: fun((term()) -> term()), Map1 :: map(), Map2 :: map().
update_with/3.
Link to this function

update_with(Path, Fun, Init, Map1)

View Source
-spec update_with(Path, Fun, Init, Map1) -> Map2
               when
                   Path :: [term()],
                   Fun :: fun((term()) -> term()),
                   Init :: [term()],
                   Map1 :: map(),
                   Map2 :: map().
update_with/4.
-spec values(Path, Map) -> Values when Path :: [term()], Map :: map(), Values :: [term()].
values/2.
-spec with(Keys, Path, Map1) -> Map2
        when Keys :: [term()], Path :: [term()], Map1 :: map(), Map2 :: map().
with/3.
Link to this function

without(Keys, Path, Map1)

View Source
-spec without(Keys, Path, Map1) -> Map2
           when Keys :: [term()], Path :: [term()], Map1 :: map(), Map2 :: map().
without/3.