I recently came across a library that does graph processing by direct indexing i.e graph[key], I have a node tree which has its child nodes under a certain attribute node.childs[key].
I was wondering if there is a way to define a type so that an attribute could be accessible through direct key mapping, such as node[key] would be mapped to node.childs[key]. Is there a way to achieve this while defining new types?