<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 4:13 PM, Chris King <span dir="ltr"><<a href="mailto:colanderman@gmail.com" target="_blank">colanderman@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for listening.  I come from the OCaml world which *almost* has heterogeneous maps done right (its object types); AFAIK no other language does (beside SQL), hence why I am so engaged :)</blockquote>

</div><br>My guess would be that there is a subtyping construction at play here. And they usually require both covariance and contravariance in input/outputs to functions. Luckily, the dialyzer is able to be more lenient and can just give up typing if possible and call it a map(). But that will not buy you much static verification, sadly.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">What one could do is to handle the homogenous case well in the dialyzer. This should be fairly straightforward if one can provide a witness that only homogenous values gets added. This doesn't solve the heterogenous case though.<br>

<br clear="all"><div><br></div>-- <br>J.
</div></div>