[erlang-questions] Refactoring for edoc

Ilya Khaprov ilya.khaprov@REDACTED
Thu Jan 12 14:36:24 CET 2017


Why it generates different docs anyway?



From: Vance Shipley<mailto:vances@REDACTED>
Sent: Thursday, January 12, 2017 04:27 PM
To: erlang-questions<mailto:erlang-questions@REDACTED>
Subject: [erlang-questions] Refactoring for edoc

We've recently discovered that edoc generates much nicer documentation
when you write type specifications using `when` such as:

     -spec example(Number) -> {ok, Result} | {error, Reason}
          when  Number :: pos_integer(), Result = integer(), Reason :: term().

... rather than the more obvious:

     -spec example(Number :: pos_integer()) -> {ok, Result ::
integer()} | {error, Reason :: term()}.

So the question becomes how can we easily refactor all of our type
specifications to use the former method?  Is there a refactoring too
well suited to this job?

erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170112/c1c39fef/attachment.htm>

More information about the erlang-questions mailing list