First you need to know that Elixir supports 2 types of vocabulary
- Erlangs native map type (for cards with a limited number of items)
map = %{} - Elixirs proprietary dictionary type (dictionaries with potentially large payload)
dict = HashDict.new
Both types should be checked with Erlangs native :erlang.is_map .
def some_fun(arg) when :erlang.is_map(arg) do
More information can be found in sections 7.2 and 7.3 ( http://elixir-lang.org/getting_started/7.html )
source share