[erlang-questions] orddict and dict and types

Kostis Sagonas kostis@REDACTED
Wed Dec 3 15:23:40 CET 2014


On 12/03/2014 03:16 PM, Russell Brown wrote:
> I swapped orddict for dict in a module. When I used orddict I took advantage of the fact orddict was just a list to have some nice detailed types. I see that dict has the type dict(key, value) in the documentation, but it’s not exported. Now I seem to have lost all that richness I was able to express with orddict (or [{Key, Val}] anyway.)
>
> Is there anyway to keep the detailed type specs and use dict() you can think of? Why does dict.erl not export dict(K, V) ?

Your message makes no sense without mentioning the OTP release you are 
referring to.  In e.g. OTP_17.0/lib/stdlib/src/dict.erl, in OTP 17.3, 
and the current maint branch I see the following line:

-export_type([dict/0, dict/2]).

Kostis



More information about the erlang-questions mailing list