Chapter 10. Dialyzer and type specifications
This chapter covers
- What Dialyzer is and how it works
- Finding discrepancies in your code with Dialyzer
- Writing type specifications and defining your own types
Depending on your inclination, the mere mention of types may make you either shriek with joy or recoil in terror. Being a dynamically typed language, Elixir spares you from having to pepper your code base with types à la Haskell. Some may argue that this leads to a quicker development cycle. But Elixir programmers shouldn’t be too smug. Statically typed languages can catch an entire class of errors at compile time that a dynamic language can only catch at runtime.
Fortunately, the fault-tolerance features baked into the language try to save ...