Built-in Types

Elixir’s built-in types are

  • Value types:

    • Arbitrary-sized integers

    • Floating-point numbers

    • Atoms

    • Ranges

    • Regular expressions

  • System types:

    • PIDs and ports

    • References

  • Collection types:

    • Tuples

    • Lists

    • Maps

    • Binaries

In Elixir, functions are a type too. They have their own chapter, following this one.

You might be surprised that this list doesn’t include things such as strings and structures. Elixir has them, but they are built using the basic types from this list. However, they are important. Strings have their own chapter, and we have a couple of chapters on lists and maps (and other dictionary-like types). The maps chapter also describes the Elixir structure facilities.

Finally, there’s some debate about whether regular expressions ...

Get Programming Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.