Modify the implicit method for converting from a function to DistanceMeasure