Get the latest tech news
Typing lists and tuples in Elixir
This article explores the design decisions of typing lists and tuples in Elixir within a sound gradual type system
While many programming languages provide functions to compose option values, one may also get rid of the additional wrapping and directly pattern match on the list instead. Both examples above are limited by the fact the type system cannot distinguish between empty and non-empty lists and therefore their handling must happen at runtime. If we completely remove elem/2 from the language and you can only access tuples via pattern matching (or by adding a literal notation such as tuple.0), then all possible bugs can be caught by the type checker.
Or read this on Hacker News