Working in macro land lately where I would like to validate if the module is also a struct forces me to understand more technical things (which is good), where I wish more functions are defined in the Core where I can focus on the intention, especially that checking __struct__ (or any double-underscore prefix + suffix) feels too close to internals.
def defines_struct?(module) do
function_exported?(module, :__struct__, 0)end
Better naming welcome.
Also, maybe do kind of the same around other internal things with the same intention.
P.S: Credit to Jon R, thank you.