<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ah, you are right (of course)<div>Stupid mistake trying to use | for dotted pair, sorry about that.</div><div><br></div><div>I was suppose to "write" something like:</div><div><br></div><div><div>-type buttons() :: </div><div> maybe_improper_list(boolean(),</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> maybe_improper_list(boolean(),</div><div> maybe_improper_list(boolean(),</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> maybe_improper_list(boolean(),[])))).</div></div><div><br></div><div>Several attempts writing this kind of specs, crashed dialyzer:</div><div><br></div><div><div><div>-type buttons() :: </div><div> maybe_improper_list(boolean(), integer()).</div><div><br></div><div>-spec get_buttons() -> {ok,buttons()}.</div><div><br></div><div>get_buttons() -></div><div> {ok,[true|12]}.</div></div></div><div><br></div><div>---</div><div><div>dialyzer list_type.erl</div><div> Checking whether the PLT /Users/tony/.dialyzer_plt is up-to-date... yes</div><div> Proceeding with analysis...</div><div>=ERROR REPORT==== 8-Jul-2012::20:41:14 ===</div><div>Error in process <0.29.0> with exit value: {{badmatch,false},[{erl_types,t_maybe_improper_list,2,[{file,"erl_types.erl"},{line,1361}]},{erl_types,t_from_form,5,[{file,"erl_types.erl"},{line,3665}]},{erl_types,t_from_form,5,[{file,"erl_types.erl"},{line,3724}]},{erl_types,list_from_form... </div><div><br></div><div><br></div><div>dialyzer: Analysis failed with error:</div><div>{{badmatch,false},</div><div> [{erl_types,t_maybe_improper_list,2,[{file,"erl_types.erl"},{line,1361}]},</div><div> {erl_types,t_from_form,5,[{file,[...]},{line,...}]},</div><div> {erl_types,t_from_form,5,[{file,...},{...}]},</div><div> {erl_types,list_from_form,5,[{...}|...]},</div><div> {erl_types,list_from_form,5,[...]},</div><div> {erl_types,t_from_form,5,...},</div><div> {erl_types,t_from_form,...},</div><div> {erl_types,...}]}</div><div>Last messages in the log cache:</div><div> Reading files and computing callgraph... done in 0.13 secs</div><div> Removing edges... done in 0.00 secs</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>/Tony</div><div><br></div><div><br></div><div><div><div><div>On 7 jul 2012, at 21:53, Richard Carlsson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 2012-07-07 13:57, Tony Rogvall wrote:<br><blockquote type="cite">Try this:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> -type buttons() :: [boolean() | [boolean() | [boolean() |<br></blockquote><blockquote type="cite">[boolean() | []]]]].<br></blockquote><br>You certainly can _write_ it like that, just like you can write "1+1" instead of "2". To a tool like Dialyzer, it will still just be interpreted as a (nonempty) list of boolean(). The exact number of elements is not tracked. And if you for example try to say "[atom() | [integer() | []]]", it will just be the same as saying "nonempty list of atom()|integer()" - the order of occurrence of the element types is also not part of the list type.<br><br> /Richard<br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></blockquote></div><br><div apple-content-edited="true">
<div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">"Installing applications can lead to corruption over time. </span><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></div><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>