There are lots of packages dedicated for structs:
Search results for: struct access @ hex.pm
Many of them adds support for Access behaviour, so you can use it with *_in functions like get_in.
That’s rather not about FP or OO paradigms, but about struct documentation. Some parts may be private, so if they are not well documented then the developer assumes that specific keys are private and should be not changed by hand. Documenting all fields would require a support for them in future as long as you would not hard deprecate them.
User-defined types | Typespecs reference @ Elixir documentation
Not really objective if you do not update the object … No worries for that. If it’s not a “simple struct” then you can follow Phoenix generators i.e. use context-based functions to fetch data from database and use struct (in ecto it’s called schema) module to define other helper functions like get_full_name etc.






















