[erlang-questions] [Dialyser] Type parametrized behaviours

Francesco Mazzoli <>
Tue Apr 24 23:43:04 CEST 2012

> The only solution I can think of, while still using -callback
> attributes, is to keep both the callback attributes and the old hrl file
> and end up with two duplicate definitions (one in the callback
> attributes and one in the specs that would be included and completed by
> the types in each callback module). I agree that it is bad practice, but
> remember that Dialyzer will check that the definitions are compatible so
> you will be actively protected from code rot.

That is still too ugly, I'd rather keep it as it is now and not type 
check that.

That said, given that no satisfactory solution exists, and given that we 
can probably find a nice way of parametrize types in behaviours, I think 
that the best thing would be to integrate that as a dialyser feature.


More information about the erlang-questions mailing list