Abstract

Basic concepts for distance functions.

Synopsis

module type has_distance = {
type t
type distance
val distance: t -> t -> distance
}

Description

module type has_distance

A module that defines a distance function for points in some space. Usually you only care about the function (and the type on which it operates), but a module type is necessary to conveniently define parametric modules that define distance functions.

type t

The type of a point in the space.

type distance

The type in which distance is measured. Usually a scalar of some sort.

val distance: t -> t -> distance

The distance function itself.