[erlang-questions] dialyzer and behaviours
Wed Jul 16 14:56:29 CEST 2014
%% I apologize if you get this message second time, but initially I posted
it through google-groups
%% interface and discovered that it is not replicated to this mailing list.
Is there any way to write a spec for dialyzer that will tell that I expect
module of certain behaviour?
-callback table() -> iolist().
%% Instead of `Mod :: atom()' I want something that will reflect that only
%% modules which implements `my_db' behaviour are allowed.
-spec create(Mod :: atom(), Vals :: [iolist(), ...]) -> iolist().
create(Mod, Vals) ->
Table = Mod:table(),
["INSERT INTO ", Table, " VALUES (", string:join(Vals, ", "), ");"].
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions