Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides the MetricSpace
typeclass.
Since: 0.1
Synopsis
- class MetricSpace s where
- diffℝ :: MetricSpace a => a -> a -> Double
Documentation
class MetricSpace s where Source #
Defines a metric space. A metric is a function \(d : M \times M \to \mathbb{R}\) s.t. for all \(x, y, z \in M\):
- \(d(x, x) = 0\)
- Positivity: If \(x \ne y\), then \(d(x, y) > 0\)
- Symmetry: \(d(x, y) = d(y, x)\)
- Triangle equality: \(d(x, z) \le d(x, y) + d(y, z) \)
Since: 0.1
Instances
MetricSpace Int16 Source # | Since: 0.1 |
MetricSpace Int32 Source # | Since: 0.1 |
MetricSpace Int64 Source # | Since: 0.1 |
MetricSpace Int8 Source # | Since: 0.1 |
MetricSpace Word16 Source # | Since: 0.1 |
MetricSpace Word32 Source # | Since: 0.1 |
MetricSpace Word64 Source # | Since: 0.1 |
MetricSpace Word8 Source # | Since: 0.1 |
MetricSpace Integer Source # | Since: 0.1 |
MetricSpace Natural Source # | Since: 0.1 |
MetricSpace Double Source # | Since: 0.1 |
MetricSpace Float Source # | Since: 0.1 |
MetricSpace Int Source # | Since: 0.1 |
MetricSpace Word Source # | Since: 0.1 |
RealFloat a => MetricSpace (Complex a) Source # | Since: 0.1 |
MetricSpace (Ratio Integer) Source # | Since: 0.1 |
MetricSpace (Ratio Natural) Source # | Since: 0.1 |