Copyright | (c) Michael Szvetits 2019 |
---|---|

License | BSD3 (see the file LICENSE) |

Maintainer | typedbyte@qualified.name |

Stability | stable |

Portability | portable |

Safe Haskell | Safe |

Language | Haskell2010 |

This module exports the types and functions needed to handle distances between two domain values and to determine if two domain values are adjacent.

# Documentation

class Ord a => Dist a where Source #

The class of domain value types for which a distance can be determined.

The distance between two elements of a domain is either finite (e.g., the
distance between the integers `3`

and `5`

is `2`

), negative infinite (e.g.,
the distance between the double values `3.0`

and `1.0`

) or positive infinite
(e.g., the distance between the double values `1.0`

and `3.0`

).

The distance is used to determine if two interval bounds are adjacent, which further allows to merge intervals and convert open to closed intervals based on the used domain value type.