3 ms·
An easy/fun testbed for this idea might be Erlang's new type specs: http://www.erlang.org/doc/reference_manual/typespec.html http://www.erlang.org/doc/reference
by tlack 16y ago
An easy/fun testbed for this idea might be Erlang's new type specs: http://www.erlang.org/doc/reference_manual/typespec.html http://www.erlang.org/doc/reference_manual/typespec.html
You could write a parse transform that wraps all exported funs in a module in some kind of type analyzing shim function, which would eventually output type specs as an .hrl you could -include().
Type specs will eventually be used by Dialyzer and other Erlang tools to issue warnings and optimize code, so the effort wouldn't be in vain.
Seems like a quick way to figure out the feasibility of your excellent idea.