[erlang-questions] orddict and dict and types

Russell Brown russelldb@REDACTED
Wed Dec 3 15:27:19 CET 2014


On 3 Dec 2014, at 14:23, Kostis Sagonas <kostis@REDACTED> wrote:

> 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:

Ha! No sense at all. I’m amazed you could read it, but thankfully you did! I didn’t think to look at version I wasn’t using. You are quite right, it is rectified in 17+. I will have to wait for riak to catch up.

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




More information about the erlang-questions mailing list