Sigils are macros and that’s off-topic.
We have a functions for them and they’re called hd(list) and tl(list). Both could be used in pattern-matching instead of syntax notation. [head | tail] notation is for a List and not a sub-type (like structs are for maps), so it’s not the best example here.
Look that by default every struct does not implement access behaviour and there are hex packages to fix that and I wanted to propose something exactly like that i.e. extend the specific struct with the functions that are known well from a Map module (like merge, put or update), but with a help of metaprogramming we can make them more helpful for LSP user, so that the editor could propose the keys based on the oldest known patterns in the language like pattern-matching and spec.
From a credo user perspective this also reduces module dependencies, so that your module does not depend on Map and MyStruct, but only MyStruct. The code is still clear and we don’t lose any editor features.






















