ModuleMixins
is a way of composing families of struct
definitions on a module level. Suppose we have several modules that contain structs of the same name. We can compose these modules such that all the structs they have in common are merged. Methods that work on one component should now work on the composed type.
using ModuleMixins
@compose module A
struct S
a
end
end
@compose module B
@mixin A
struct S
b
end
end
@assert fieldnames(B.S) == (:a, :b)
See the full documentation.
If you use ModuleMixins.jl in your work, please cite using the reference given in CITATION.cff.
If you want to make contributions of any kind, please first that a look into our contributing guide directly on GitHub or the contributing page on the website.