[erlang-questions] [Dialyser] Type parametrized behaviours

Francesco Mazzoli francesco@REDACTED
Tue Apr 24 16:42:58 CEST 2012


Hi,

I have recently updated some code to use the new callback signatures for 
behaviours. Before that, we simply used a .hrl file that we included in 
each implementing module.

While hacky, the old approach had an advantage: we could include in the 
.hrl specs some types that were to be defined in the including file, and 
then used in type signatures.

It would be useful to be able to parametrize behaviours by type more 
nicely, since most behaviours specs are dominated by 1 or 2 types 
(classically some kind of state) and as of now no typechecking takes 
place on those types. That might be achieved with some pre-processor 
directive, e.g. -behaviour_type(whatever).

What do you think?

Francesco.



More information about the erlang-questions mailing list