<div>Hi, Dmitry.</div><div> </div><div>May be "tuple(Type)" help you?</div><div> </div><div>-type my_tuple() :: tuple(integer()). % {1}, {1,1}, {1, ...} </div><div> </div><div>29.11.2012, 05:10, "Dmitry Kolesnikov" <dmkolesnikov@gmail.com>:</div><blockquote type="cite"><p>Hello,<br /><br />Thanks for response!<br />Let me explain better what I am trying to achieve.<br />"The shorthand [T,...] stands for the set of non-empty proper lists whose elements are of type T." <br />I am looking for similar definition but for tuples.<br /><br />My application serialises tuples into disk. The size of tuple is unbound but tuple elements a fixed to string, binary, number, boolean or undefined. I cannot use " "|" operator to define as many variants as you like" because number of variants is unlimited. Well practically, I do have a hard limit of 4096 elements per tuple but I am lazy to type in 4096 variants :-) <br /><br />- Dmitry<br /><br />On Nov 28, 2012, at 11:50 PM, Motiejus Jakštys <<a href="mailto:desired.mta@gmail.com">desired.mta@gmail.com</a>> wrote:</p><blockquote> On Wed, Nov 28, 2012 at 9:10 PM, Dmitry Kolesnikov<br /> <<a href="mailto:dmkolesnikov@gmail.com">dmkolesnikov@gmail.com</a>> wrote:<br /><blockquote> but compiler fails syntax error before: ','<br /><br /> -- CLIP --<br /> -type value()     :: string() | binary() | number() | boolean() | undefined.<br /> -type entity()    :: [{atom(), value()}] | {field()}.</blockquote> These should be fine.<br /><blockquote> -type field()      :: value() | value(), field().</blockquote> Maybe you meant<br /> -type field() :: value() | {value(), field()}.<br /><br /> ?<br /><br /> In general, if you want to define tuples of different sizes in -spec,<br /> you use the "|" operator to define as many variants as you like.<br /><br /> Likely I don't understand what you are trying to define.<br /><br /> -- <br /> Motiejus Jakštys</blockquote><p>_______________________________________________<br />erlang-questions mailing list<br /><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br /><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></p></blockquote>