[erlang-questions] -type dict(_, _) ?

Stavros Aronis <>
Thu May 31 01:23:50 CEST 2012


Hi,

This is a planned extension for Dialyzer. Currently support for parametric 
types is rather weak (e.g. even a type name can appear only once, 
regardless of arity, so no dict/0 and dict/2 types can be declared together 
in the same module). Therefore only the dict/0 type has been defined, hence 
the error you get.

If you are already implementing this with a dict, I would suggest that you 
define the type as:

 -type players :: dict(). %dict(mpserver:userid(), mpserver:player()).

... and hope that the commented out version will be supported soon!

Regards,

Stavros

On Wednesday, May 30, 2012 10:39:44 PM UTC+2, Motiejus Jakštys wrote:
>
> Hi all,
>
> let's say I have a proplist of players: userid and player itself:
>
> -type players() :: list({mpserver:userid(), mpserver:player()}).
>
> Almost fine, but I know that keys are unique. In that case, it makes
> sense to use a dict:
> -type players() :: dict(mpserver:userid(), mpserver:player()).
>
> This throws "type not found" error. Why is it unsupported? Maybe
> something similar is supported, but I don't know how? What data
> structure do you use in this situation, and why? And do you benefit
> from dialyzer?
>
> Thanks,
> Motiejus Jakštys
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120530/d6e41c65/attachment.html>


More information about the erlang-questions mailing list