In the case of Structs, they are really just Maps with a special key that identifies the module that they are associated with.
iex> foo = 1..3
iex> bar = Map.get(foo, :“__struct__”)
iex> Kernel.apply(bar, :“range?”, [foo]) == Range.range?(foo)
In the case of Structs, they are really just Maps with a special key that identifies the module that they are associated with.
iex> foo = 1..3
iex> bar = Map.get(foo, :“__struct__”)
iex> Kernel.apply(bar, :“range?”, [foo]) == Range.range?(foo)