[erlang-questions] dialyzer and behaviours

Fred Hebert mononcqc@REDACTED
Wed Jul 16 16:15:49 CEST 2014

On 07/16, Daniil Churikov wrote:
> Thank you Sean for your response. The problem is, how to tell to dialyzer
> that `my_db:create(Mod, Vals)'
> is accepts only Mod's which implements `-behaviour(my_db)'? and not an
> arbitrary atom?

As far as I know, there's no good way to do that in Erlang. Just
document it, and blame the caller when they don't implement the
behaviour properly (their stuff will crash, or they'll get a compile
warning when the behaviour is missing functions).


More information about the erlang-questions mailing list