@mudasobwa is technically correct, but there’s a bit more going on here. Let’s start with something simple. All modules have a name, and that name is an atom.
In elixir syntax, if you start with
: you make an atom. Here are some examples:
iex(4)> :"foo 111"
Elixir, as a language on the BEAM VM, also needs to create its modules with atom names. However Elixir didn’t want to worry about conflicts between existing erlang module names and new Elixir module names. Thus, Every elixir module name (an atom) is prefixed with
:Elixir. This gets annoying to type though, so if you write a capital letter identifier like
Enum this is what is technically called an “alias” for the atom
However as @mudasobwa has noted, just that all module names are atoms doesn’t mean that all atoms are module names. You can make atoms with any text value you like, and the same is true of aliases, which are simply a “shorthand” for certain atoms.
You might think that the whole issue with conflicting with Erlang modules would be solved by just making things capital, IE Elixir could use
:Foo and if erlang had
:foo that would be fine since
:Foo != :foo. However both of those modules, when compiled, would result in
foo.beam files, which would conflict on file systems that are case insensitive.