-module(dialyzer_example). -compile(export_all). %%% For dialyzer to function properly it is recommended that %%% all functions have spec defined in this manner. Without %%% this dialyzer guesses the input and output type which is %%% not as good as specifying them explicitly. -spec main() -> ok. main() -> io:format("Read code, comments and use 'dialyzer ~p' command to see the output.~n", [?FILE]), ok. %%% If we do not specify -spec() Dialyzer can infer the type to be %%% add(number(), number()) -> number() %%% Same can also be found using typer from linux shell as %%% typer f077_dialyzer.erl %%% add(A, B) -> A+B.