What does this OpenTelemetry typespec mean?

When looking at OpenTelemetry’s docs on the types of attribute values, I stumbled upon this typespec:

    unicode:unicode_binary() |
    atom() |
    number() |
    boolean() |
    [unicode:unicode_binary() | atom() | float() | integer() | boolean()] |
    {unicode:unicode_binary() | atom() | float() | integer() | boolean()}.

Can somebody tell me what does the last one mean? Is it like “a tuple with a single element that can be of the following types”? Or does it mean a “a tuple with an arbitrary amount of elements, each of which can be of the following types”? Or is it something else?

I tried dyalizing it, and it looks like it means “a tuple with a single element that can be of the following types”. You don’t see single-element tuples that often.

1 Like

What weirded me out is that the OpenTelemetry library even uses this syntax at all. Wondered if there’s more to it than I can see (and I ran it through dialyzer as well).

1 Like

Hah, my bad, this is a mistake.

It should just be tuple() and isn’t able to define the types the tuple can contain.

1 Like

I see, thank you!