get_map/4 is an Erlang function exported by "age_lists" module.
This function is searching for a map within a list of terms with particular pair of key name and value associated to this key, and returns the map found within the input list.
Perhaps it looks complex, however, the idea is quite simple - to combine #{} and {Key, Value} into one list, and to find the most relevant map structure into this list of terms. The function returns a map or reports an error that there is no occurrence of such a map structure.
You can use this function in different context, for example, to manage complex configurations or options. See also the references and the code sample below.
|