Chapter 9Types
Erlang has a type notation that we can use to define new data types and add type annotations to our code. The type annotations make the code easier to understand and maintain and can be used to detect errors at compile time.
In this chapter we’ll introduce the type notation and talk about two programs that can be used to find errors in our code.
The programs we’ll discuss are called dialyzer and
typer and are included in the standard Erlang distribution.
Dialyzer stands for “DIscrepancy AnaLYZer for ERlang
programs,” and it does precisely that which is implied by its
name: it finds discrepancies in Erlang code. typer provides information about the types used in your programs. Both the dialyzer and typer work perfectly well ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access