Skip to content

Instantly share code, notes, and snippets.

@kevsmith
Created October 29, 2012 13:56
Show Gist options
  • Select an option

  • Save kevsmith/3973703 to your computer and use it in GitHub Desktop.

Select an option

Save kevsmith/3973703 to your computer and use it in GitHub Desktop.
Erlang docstrings for edoc descriptions and dialyzer specs
1> specs(test).
greeting(string(), integer()) -> [string()] | nil()
foo() -> ok
doit() -> ok
ok
2> specs({test, greeting, 2}).
greeting(string(), integer()) -> [string()] | nil()
ok
3> docs({test, greeting, 2}).
greeting/2: "This is another test"
ok
4> docs(test).
greeting/2: "This is another test"
foo/0: "Testing 456"
doit/0: "Testing 123"
------------
Specs and edoc description embedded in the compiled beam file using custom attributes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment