How do you exit out of erl and iex?

Ah, I see, thanks! In this case you can do i mod in Elixir. It shows all of the module information (and it works for all data types).

We don’t have something that prints a list of all modules but I honestly don’t see that being useful (plus autocompletion is most likely a quicker way to explore which modules are loaded).

1 Like

Though i mod in iex does some strange things.

iex(11)> i :a
Term
  :a
Data type
  Atom
Reference modules
  Atom
Implemented protocols
  IEx.Info, Inspect, List.Chars, String.Chars
iex(12)> i Bert
Term
  Bert
Data type
  Atom
Raw representation
  :"Elixir.Bert"
Reference modules
  Atom
Implemented protocols
  IEx.Info, Inspect, List.Chars, String.Chars

The module Bert doesn’t exist. Also giving an atom like `:“Elixir.Foo” assumes it is a module name not an atom. Who implements the protocols? If it is the shell why are they listed here as they have nothing to do with the thing being inspected?

I think that giving raw representation is useful, as someone can be surprised with fact that :"Elixir.Bert" == Bert. Protocol implementations are implemented for Atom so automatically Bert implements them as well (IEx.Info shows this information AFAIK, Inspect allows calling Kernel.inspect/{1,2} on such value, List.Chars/String.Chars allows usage of such value in charlist/string interpolation and usage of Kernel.to_charlist/1/Kernel.to_string/1 functions).

1 Like

Right, i works for all data types, not only modules. But if you feed it a module, it will show specific module information. Otherwise it falls back to show only atom specific information.

1 Like