[erlang-questions] dict() type issue

Michael Truog <>
Thu Jan 2 23:56:10 CET 2014


Hi!

The dict() type being defined as opaque prevents it from being checked with other dictionary implementations that rely on tuples.  If you do "is_tuple(D), element(1, D) =:= dict" dialyzer will complain once it realizes that D is a dict(), despite the fact it is a tuple underneath the opaque type.  To help with the migration to maps, a new function is_dict/1 could help check the type during runtime, in a way that doesn't anger dialyzer.  Ideally, is_dict/1 would be a guard function, but I assume that is problematic unless it was added to the erlang module.  Is there any reason we wouldn't want an is_dict/1 function?

Thanks,
Michael



More information about the erlang-questions mailing list