| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Plankton.Metric
Description
Metric classes
- class MultiplicativeUnital a => Signed a where
- class Normed a b where
- class Metric a b where
- class AdditiveGroup a => Epsilon a where
- (≈) :: Epsilon a => a -> a -> Bool
Documentation
class MultiplicativeUnital a => Signed a where Source #
signum from base is not an operator replicated in numhask, being such a very silly name, and preferred is the much more obvious sign. Compare with Norm and Banach where there is a change in codomain
abs a * sign a == a
Generalising this class tends towards size and direction (abs is the size on the one-dim number line of a vector with its tail at zero, and sign is the direction, right?).
class Normed a b where Source #
Like Signed, except the codomain can be different to the domain.
Minimal complete definition
class Metric a b where Source #
distance between numbers
distance a b >= zero
distance a a == zero
\a b c -> distance a c + distance b c - distance a b >= zero &&
distance a b + distance b c - distance a c >= zero &&
distance a b + distance a c - distance b c >= zero &&Minimal complete definition
class AdditiveGroup a => Epsilon a where Source #
todo: This should probably be split off into some sort of alternative Equality logic, but to what end?
Minimal complete definition