The Thrift Erlang compiler generates macros for consts. This is great for scalar types and structs. However the macro that is generated for a map is something like
This is not as useful as the other macros, because any use of this macro will generate the dict at run time. (It is possible to work around this issue by using the ct_expand parse transform.)
It would be better to generate a function directly to do the transform. The function for the previous example would be
Similarly, the macro that is generated for a list is something like:
This representation is fine if you want to iterate over the elements of the list, but is not efficient if you need to look an element because lists in Erlang are implemented as singly-linked lists. For lookups, it would be better to generate a tuple and then use element(N, Tuple) to extract the nth element.
The thrift generator could generate a function to do the lookup: