[erlang-questions] How to help improve specs in OTP?

Loïc Hoguin <>
Tue Jun 28 00:02:01 CEST 2011


Hello,

I'm looking into improving even more the specs I have in cowboy and am
wondering what are the guidelines on how to help improve the specs in
OTP so that applications can make better use of the types already
defined or the library functions.

Note that all my comments are about R14B03 and might not be up to date
anymore.

There's some types in the calendar module that define the datetime,
year, months, days, and so on. They are not exported. Would a patch
adding -export_type to the useful types be accepted? I'm assuming here
that useful means a type used for the arguments and/or return values of
the module's exported functions.

Same comment about inet:ip_port(), it would be better if we could just
use it without redefining it. Especially considering other types in that
module are exported, like inet:socket(). What about opaque types? Should
they be exported too?

There's also modules that have no typespecs at all yet. How should we go
about adding them? Any guidelines to follow? Style varies depending on
the module, too, like 'atom' versus atom.

Finally, what's the best way to test that kind of changes? I'm guessing
I don't need to recompile everything all the time...

Please send any guidelines or advices and I'll start working on a few
patches.

-- 
Loïc Hoguin
Dev:Extend



More information about the erlang-questions mailing list