Reducing some code duplication in Ash enums
I find myself defining a few enum modules in my application like this,
Would it be appropriate to move these functions that I have copied across modules into a module and then
Would it be appropriate to move these functions that I have copied across modules into a module and then
use the module to bring them into my enum modules?Solution
I added some functions to Enum awhile back for this. Pretty sure there are some examples in the docs.
https://hexdocs.pm/ash/Ash.Type.Enum.html#module-value-labels-and-descriptions
https://hexdocs.pm/ash/Ash.Type.Enum.html#module-value-labels-and-descriptions
