[erlang-questions] Dialyzer and improper lists

Aliaksey Kandratsenka alkondratenko@REDACTED
Thu Dec 27 00:28:21 CET 2012


It appears dialyzer complains loudly about any code that builds improper
lists. And there appears to be no local way to silence that warning.

It's true that sometimes it's a sign of bug. But on the other hand dialyzer
docs saying there's no reason to use improper lists (even in ALL CAPS) is
clearly wrong. According to my understanding improper list of size 2 needs
just 2 words (single cons pair and no headers), but binary tuple needs one
extra word for header.

And erlang's stdlib has a bunch of places where cons pair is used as a
binary tuple. E.g. dict.

While docs should not necessarily point folks to low-level tricks like
that, they IMHO should be fixed to reflect reality.

But IMHO most importantly, there should be some way to say to dialyzer "hey
I really mean improper list here" without disabling improper list check
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121226/d2fc7d39/attachment.htm>

More information about the erlang-questions mailing list