Skip to content

Commit e59e360

Browse files
authored
Improve 'Types and Specs' introduction (elixir-lang#1643)
1 parent f9fb17a commit e59e360

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

getting-started/typespecs-and-behaviours.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Elixir is a dynamically typed language, so all types in Elixir are checked at ru
1111
1. declaring typed function signatures (also called specifications);
1212
2. declaring custom types.
1313

14+
Typespecs are useful for code clarity and static code analysis (for example, Erlang's [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html) tool).
15+
1416
### Function specifications
1517

1618
Elixir provides many [built-in types](https://hexdocs.pm/elixir/typespecs.html#built-in-types), such as `integer` or `pid`, that can be used to document function signatures. For example, the `round/1` function, which rounds a number to its nearest integer. As you can see [in its documentation](https://hexdocs.pm/elixir/Kernel.html#round/1), `round/1`'s typed signature is written as:

0 commit comments

Comments
 (0)