I’m looking to defined types which have certain fields, such as a matrix, and that constructs that matrix according to certain rules at the moment of type definition. Thus the user need not give the matrix, as it will be filled anyways. The way I found to do it is the following, but it feels wrong; is there a cleaner way?

```
struct RandHaar <: Interferometer
m::Int
U::Matrix{ComplexF64}
RandHaar(m,U) = new(m,rand_haar(m)) #the “rand_haar” function gives a specific matrix (sampled according from the haar measure in this case)
end
RandHaar(n) = RandHaar(n, Matrix{ComplexF64}(undef,n,n))
```