[erlang-questions] Refactoring for edoc

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


Hello



Why it generates different docs anyway?



Regards,

Ilya



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?

--
     -Vance
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions
-------------- 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