<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Thank you Stavros, that sounds perfect. I'll go poke around in dialyzer_contracts and use it as a guide to consuming erl_types. </div><div><br></div><div>Cheers,</div><div>Tim</div><br><div><div>On 2 Mar 2012, at 12:18, Stavros Aronis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Tim,<div><br></div><div>It would be better in my opinion if you tried to rely only on the erl_types module. erl_types:t_from_form/1 and erl_types:t_is_subtype/2 could possibly be enough for you.</div><div><br></div><div>
Dialyzer modules export few of their functions and these usually return the data in a way that is useful to Dialyzer and difficult to see through. You can however follow the code in dialyzer_contracts module, especially dialyzer_contracts:store_tmp_contract/5 and dialyzer_contracts:process_contract_remote_types/1. dialyzer_contracts:store_tmp_contract/5 actually calls erl_types:t_from_form/1 to convert an abstract syntax spec into the representation used in erl_types and after dialyzer_contracts:process_contract_remote_types/1 has done its magic it's very easy to use erl_types:t_is_subtype/2 for the checks that you are describing!</div>
<div><br></div><div>Cheers,</div><div>Stavros</div><div><br><br><div class="gmail_quote">On Fri, Mar 2, 2012 at 12:59 PM, Tim Watson <span dir="ltr"><<a href="mailto:watson.timothy@gmail.com">watson.timothy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>After poking around in the dialyzer source code a little bit, I think what I'm basically after is being able to run dialyzer_contracts:check_contract/2 independently, without doing a full analysis. I don't care about processing a whole call graph, I'm really just looking to compare two function signatures to figure out if they're compatible. Possibly I'm also interesting in taking one function spec and a set of potentially matching specs and finding the best (most strict?) success typing. Is that something I can do by selectively reusing parts of dialyzer?</div>
<div><br></div><div>I've poked around in the shell trying to do things like get_top_level_signatures, get_spec_info and things like that, but I can't quite figure out the right entry point to start with. I've even tried a few of the debugging functions such as dialyzer_succ_typings:doit/1 but to no avail.</div>
<div><br></div><div>Any pointers would be gratefully received! </div><div><br></div><div>Cheers,</div><div><br></div><div>Tim  </div><div class="im"><br><div><div>On 1 Mar 2012, at 21:03, Stavros Aronis wrote:</div><br><blockquote type="cite">
Hi Tim!<div><br></div><div>I am not sure what you mean by a "type server", as Dialyzer does not really have a "component" that I could imagine being separated and labeled so. Dialyzer has the ability to store the specs and exported types in the PLT and from there use them to increase the precision of the analysis it performs.</div>
<div><br></div><div>What do you mean by "working with types"?</div><div><br></div><div>Regards,</div><div>Stavros<br><br>On Thursday, March 1, 2012 4:43:33 PM UTC+1, Tim Watson wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<p>Both PropEr and Dialyzer appear to have a 'type server' that provides functions for working with type specs. What are the chances of this being available as a separate unit? There is currently very little support for working with types, as the previous post about lack of support in erl_syntax pointed out. It would be nice to see type specs being better supported.</p><p>Cheers,</p><p>Tim<br>______________________________<u></u>_________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br>
</p><div><br></div><div><br></div></blockquote></div>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br></div></div></blockquote></div><br></div>
</blockquote></div><br></body></html>