Suppose I’m looping over a large vector of distributions from Distributions.jl.

How can I automatically find how many parameters there are in a distribution?
I want a function nparams(d) where: nparams(Normal)=2 since Normal(μ,σ) nparams(BetaBinomial)=3 since BetaBinomial(n,α,β)