<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2013-10-30 15:38, Chris King wrote:<br>
</div>
<blockquote cite="mid:op.w5ruyldnvksmfo@shuttle.squirrel"
type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style type="text/css">body { font-family:'DejaVu Sans Mono'; font-size:12px}</style>
On Wed, 30 Oct 2013 10:24:20 -0400, Björn-Egil Dahlberg
<a class="moz-txt-link-rfc2396E" href="mailto:egil@erlang.org"><egil@erlang.org></a> wrote:<br>
<br>
<blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px
solid; padding-left: 1ex">
<div class="moz-cite-prefix"><br>
</div>
<blockquote cite="mid:op.w5rtcxqcvksmfo@shuttle.squirrel"
type="cite">
<div>BTW, is there a plan for a type notation for these new
maps, or for how to get Dialyzer to usefully type-check
them?</div>
</blockquote>
<br>
Yes. The type notation is the same as with other terms.</blockquote>
<div><br>
</div>
<div>Ya, I just found that and posted a separate e-mail with my
analysis. I believe the type signatures to be inconsistently
specified.</div>
<div><br>
</div>
<div><br>
</div>
<blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px
solid; padding-left: 1ex">How well Dialyzer would be able to
handle it is a different matter. I plan to make them really
stupid at first, meaning opaque map(). Later incarnations of
dialyzer could be increasingly smarter.<br>
</blockquote>
<br>
<div>I think it will be very difficult for Dialyzer to
automatically tease apart the homogeneous (list-like) and
heterogeneous (tuple-like) use cases, even if they are not
mixed. In particular, as I mentioned in my other e-mail, the
useful type variance in the heterogeneous use case is the
opposite of the useful type variance in the homogeneous case.
(i.e., we want to know that a heterogeneous map contains *at
least* some keys; we want to know that a homogeneous map
contains *at most* some keys).</div>
<div><br>
</div>
<div>Maybe I am wrong – I hope I am – but without a plan and
without the hetero-homogeneous distinction, I fear "later" could
be "never".</div>
</blockquote>
<br>
First, I'm far from a Dialyzer expert .. <br>
<br>
However, I think we can view maps as functions and the pairs as
function clauses. It should be the same problem space, i.e. range
and domains, product and unions.<br>
<br>
so,<br>
<br>
-spec wat() -> #{ binary() => integer()}.<br>
<br>
would exhibit the same problem/solution as,<br>
<br>
-spec foo(binary()) -> integer().<br>
<br>
foo(B) when is_binary(B) -> binary_to_integer(B).<br>
<br>
That's my view at least, I could very well be wrong also here.<br>
But as I said, for a first stab at it, it should be strictly opaque
map().<br>
<br>
I've looked at your other mail but I don't have time to get into the
details right now. <br>
Thank you for feedback! It is much appreciated and I will look into
it when the time arrives!<br>
<br>
// Björn-Egil<br>
</body>
</html>