Sure, but the signatures are so different that with the current design, it is very unlikely that one could use sample
in generic code, like +
. Which is what you would expect, as StatsBase’s is sample
methods are low-level utility functions, while in Turing they are part of the high-level API.
Note that I don’t indend to single out Turing here — other packages do similar things, and I have done this myself. The idea that recycling a symbol for a completely different, non-conflicting signature may not be a good design for Julia evolved with practice and I think is a good principle to follow.