[erlang-questions] orddict and dict and types

Magnus Henoch magnus@REDACTED
Wed Dec 3 15:23:31 CET 2014


Russell Brown <russelldb@REDACTED> writes:

> Hi, 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) ?

In 17.0, the type dict:dict/2 is exported.  Perhaps you're using an
earlier version?

Regards,
Magnus



More information about the erlang-questions mailing list