<div dir="ltr">Instead of rewriting everyone's code, my vote is on adding an option to Edoc<div>that would pretty print specs as if they were written using `when`.</div><div><br></div><div>Here is a mix of the two styles, as an example: <a href="http://erldocs.com/current/edoc/edoc_lib.html?i=5&search=edoc#edoc">http://erldocs.com/current/edoc/edoc_lib.html?i=5&search=edoc#edoc</a></div><div><br></div><div>Note to self: fix that bug where instead of `[term()]` it should say `proplist() = [term()]`!</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><br></div><div>Cheers,</div><div>-- </div><div>Pierre Fenoll</div></div><div><br></div></div></div></div>
<br><div class="gmail_quote">On 12 January 2017 at 14:36, Ilya Khaprov <span dir="ltr"><<a href="mailto:ilya.khaprov@publitechs.com" target="_blank">ilya.khaprov@publitechs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div lang="EN-US" link="blue" vlink="#954F72">
<div class="m_3304963890422639499x_WordSection1">
<p class="m_3304963890422639499x_MsoNormal">Hello</p>
<p class="m_3304963890422639499x_MsoNormal"> </p>
<p class="m_3304963890422639499x_MsoNormal">Why it generates different docs anyway?</p>
<p class="m_3304963890422639499x_MsoNormal"> </p>
<p class="m_3304963890422639499x_MsoNormal">Regards, </p>
<p class="m_3304963890422639499x_MsoNormal">Ilya</p>
<p class="m_3304963890422639499x_MsoNormal"> </p>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="m_3304963890422639499x_MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:vances@sigscale.org" target="_blank">Vance Shipley</a><br>
<b>Sent: </b>Thursday, January 12, 2017 04:27 PM<br>
<b>To: </b><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions</a><br>
<b>Subject: </b>[erlang-questions] Refactoring for edoc</p>
</div>
<p class="m_3304963890422639499x_MsoNormal"> </p>
</div>
</div><div><div class="h5">
<font size="2"><span style="font-size:10pt">
<div class="m_3304963890422639499PlainText">We've recently discovered that edoc generates much nicer documentation<br>
when you write type specifications using `when` such as:<br>
<br>
-spec example(Number) -> {ok, Result} | {error, Reason}<br>
when Number :: pos_integer(), Result = integer(), Reason :: term().<br>
<br>
... rather than the more obvious:<br>
<br>
-spec example(Number :: pos_integer()) -> {ok, Result ::<br>
integer()} | {error, Reason :: term()}.<br>
<br>
<br>
So the question becomes how can we easily refactor all of our type<br>
specifications to use the former method? Is there a refactoring too<br>
well suited to this job?<br>
<br>
-- <br>
-Vance<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
</div>
</span></font>
</div></div></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>