dimitarvp
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?
Marked As Solved
tristan
Hah, my bad, this is a mistake.
It should just be tuple() and isn’t able to define the types the tuple can contain.
Also Liked
trisolaran
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.
dimitarvp
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).
Last Post!
dimitarvp
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security










