<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><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></div></blockquote>But you can not _write_ (why do you use underscore before and after write? ) things like </div><div>-spec get_buttons1() -> {ok, [boolean(),boolean(),boolean(),boolean()]}.</div><div>Because you will get a syntax error!. </div><div>Why is the "dotted pair" notation supported if it does not work ?</div><div>It can not be harder to support then supporting pairs ? (For the record I do think it could be a bit harder :)</div><div><br></div><div>BTW </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>The 1+1 = 2 example was totally silly in my opinion.</div><div><br></div><div>/Tony</div><div><br></div><div><br></div><div><blockquote type="cite"><div> /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></body></html>