DistanceFn<T> typedef

double DistanceFn (
  1. T,
  2. T

A function that returns the measurable distance between any two instances of type T.

For nums, the distance is the difference between the two values. For DateTimes, the distance is the milliseconds between the two times.


typedef DistanceFn<T> = double Function(T, T);