You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: getting-started/typespecs-and-behaviours.markdown
+2
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ Elixir is a dynamically typed language, so all types in Elixir are checked at ru
11
11
1. declaring typed function signatures (also called specifications);
12
12
2. declaring custom types.
13
13
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
+
14
16
### Function specifications
15
17
16
18
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