Typing lists and tuples in Elixir

We are developing a type system for Elixir that enables sound gradual typing, safely combining static and dynamic code. Most programming languages only catch typing errors, not runtime errors like division by zero. In Elixir, handling empty lists can be done through head functions that may raise errors or return option types. Distinguishing between empty and non-empty lists in the upcoming type system will enhance Elixir’s capabilities. Accessing tuples by index poses additional challenges that need careful consideration. Elixir’s type system embraces a gradual approach, allowing for static and dynamic typing. The article explores various design decisions and trade-offs involved in extending Elixir’s type system to support lists and tuples.

https://elixir-lang.org/blog/2024/08/28/typing-lists-and-tuples/

To top