I do not want to go much further with this, but I fail to understand what kind of changes would trigger this need for extensive changes. If the behaviour code needs to be agnostic of the type of this state variable and "term()" needs not be changed due to this reason. The type definitions are already in every module because that's where the specialization is being made. On the other hand, if the same type is used in many modules then it should be defined in the behaviour module and exported. Then it can be used in all of them, without any need of copying. Could you provide a more detailed example?<div><br></div><div>Stavros<br><br></div>On Tuesday, April 24, 2012 9:47:06 PM UTC+2, Francesco Mazzoli wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 24/04/12 20:36, Stavros Aronis wrote:<br>> In this case you can leave generic definitions in the -callback<br>> attributes and write the fully specified specs in the callback module:<br>><br>> %% Behaviour module:<br>> ...<br>> -callback step(State :: term()) -> NewState :: term().<br>> ...<br>><br>> %% Callback module:<br>> ...<br>> -type state() :: #state{}.<br>> ...<br>> -spec step(state()) -> state().<br>> ...<p>Yes, this works but is tedious and error prone, each time you change the <br>behaviour you have to change each implementing module.</p><p>You end up manually doing something that a computer does much better <br>(copy-pasting code).</p><p>Francesco.<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></p><p></p><p></p></blockquote>