Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- class C a where
- defltIsZero :: (Eq a, C a) => a -> Bool
Documentation
Maybe the naming should be according to Algebra.Unit:
Algebra.Zero as module name, and query
as method name.
C Double Source # | |
C Float Source # | |
C Int Source # | |
C Int8 Source # | |
C Int16 Source # | |
C Int32 Source # | |
C Int64 Source # | |
C Integer Source # | |
C Word Source # | |
C Word8 Source # | |
C Word16 Source # | |
C Word32 Source # | |
C Word64 Source # | |
C T Source # | |
C T Source # | |
C T Source # | |
C T Source # | |
C v => C [v] Source # | |
(C a, C a) => C (T a) Source # | |
(Eq a, Num a) => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
C a => C (T a) Source # | |
(C v0, C v1) => C (v0, v1) Source # | |
C v => C (T a v) Source # | |
C v => C (T a v) Source # | |
C v => C (T a v) Source # | |
(C v0, C v1, C v2) => C (v0, v1, v2) Source # | |
defltIsZero :: (Eq a, C a) => a -> Bool Source #
Checks if a number is the zero element.
This test is not possible for all C
types,
since e.g. a function type does not belong to Eq.
isZero is possible for some types where (==zero) fails
because there is no unique zero.
Examples are
vector (the length of the zero vector is unknown),
physical values (the unit of a zero quantity is unknown),
residue class (the modulus is unknown).