Closed niahoo closed 7 years ago
Thanks for your interest in the project! Currently, ShorterMaps
works on Structs because they are maps, e.g.: ~M{state|val1, val2}
, which expands to %{state|val1: val1, val2: val2}
. By adding the syntax you propose, you'd gain compile-time checking of keys.
I think this is definitely syntax we can and should support, though at the current moment my time is a bit stretched. I'll definitely add this with my next update, but if you are looking to use it right away, I'll gladly welcome a pull request.
Chris
Sure I would like to help, but I'm not sure I could know how to do that. I'll give it a try, though :)
I've published version 2.2, which provides this functionality. Please comment after you've given it a try to let me know if it solves your need.
Hey, thank you, it works great !
Hi ?
Would it be feasible to have support for struct updates :
~M(%State state|val1, val2)
?