Description
The package Distances
groups distances by their mathematical properties (symmetry and triangular inequality), via the type hierarchy Metric <: SemiMetric <: PreMetric
.
This type hierarchy is very limiting. In certain contexts, it makes more sense to group distances by their object of application (for instance string distances), or by their general algorithm (for instance, q-gram distances are a certain type of string distances that operate on qgrams). In StringDistances
, I would love to be able to define certain functions on these groups. This is not possible, however, due to the lack of multiple inheritance in Julia.
For this reason, I'd prefer SemiMetric/Metric to be traits, rather than types. This would keep the implementation of pairwise
/colwise
efficient, while making it easier for external packages to define their own abstract types.