smallex v0.1.6 MapList

Map list library.

Link to this section Summary

Link to this section Functions

Link to this function find(map_list, match_map, match_key)
Link to this function make_empty_map_without_key(map_list, match_key, no_match_value)
Link to this function merge(base_map_list, add_map_list, match_key, no_match_value)

Outer join keys to map-list on same key-value pair from another

Examples

iex> MapList.merge( [ %{ "a" => "key1", "b" => 12 }, %{ "a" => "key2", "b" => 22 } ], [ %{ "a" => "key1", "c" => 13 }, %{ "a" => "key3", "c" => 23 } ], "a", "no_match" )
[ %{ "a" => "key1", "b" => 12, "c" => 13 }, %{ "a" => "key2", "b" => 22, "c" => "no_match" } ]
Link to this function no_match(base_map_list, match_map_list, match_key)
Link to this function replace(base_map_list, add_map_list, match_key)

Inner join keys to map-list on same key-value pair from another

Examples

iex> MapList.replace( [ %{ "a" => "key1", "b" => 12 }, %{ "a" => "key2", "b" => 22 } ], [ %{ "a" => "key1", "c" => 13 }, %{ "a" => "key3", "c" => 23 } ], "a" )
[ %{ "a" => "key1", "b" => 12, "c" => 13 }, %{ "a" => "key2", "b" => 22 } ]
Link to this function zip(map_list1, map_list2)

Zip two lists to map

Examples

iex> MapList.zip( [ "a", "b", "c" ], [ 1, 2, 3 ] )
%{ "a" => 1, "b" => 2, "c" => 3 }