Algebra.Real
Synopsis
class (C a, C a, Ord a) => C a where
 abs :: a -> a signum :: a -> a
Documentation
 class (C a, C a, Ord a) => C a where Source

This is the type class of an ordered ring, satisfying the laws

```              a * b === b * a
a + (max b c) === max (a+b) (a+c)
negate (max b c) === min (negate b) (negate c)
a * (max b c) === max (a*b) (a*c) where a >= 0
```

Note that abs is in a rather different place than it is in the Haskell 98 Prelude. In particular,

```   abs :: Complex -> Complex
```

is not defined. To me, this seems to have the wrong type anyway; Complex.magnitude has the correct type.

Note: The abs function can be defined for Additive and Ord, the Ring constraint is not needed. We may move signum to the new RealRing class.

Methods
 abs :: a -> a Source
 signum :: a -> a Source
Instances
 C Double C Float C Int C Int8 C Int16 C Int32 C Int64 C Integer C Word C Word8 C Word16 C Word32 C Word64 C T C T C T (C a, C a) => C (T a) (C a, C a) => C (T a) (C a, C a, C a) => C (T a) C v => C (T a v) (Ord i, C a) => C (T i a) C v => C (T a v)
Produced by Haddock version 2.4.2