Safe Haskell | None |
---|---|
Language | Haskell98 |
Documentation
class (C a, C a) => C a where Source #
The two classes C
and C
exist to allow convenient conversions,
primarily between the built-in types.
They should satisfy
fromInteger . toInteger === id toRational . toInteger === toRational
Conversions must be lossless, that is, they do not round in any way. For rounding see Algebra.RealRing.
I think that the RealIntegral superclass is too restrictive. Non-negative numbers are not a ring, but can be easily converted to Integers.
Instances
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 a => C (T a) Source # | |
Integral a => C (T a) Source # | |
(C a, C a) => C (T a) Source # | |
C a => C (T a) Source # | |
fromIntegral :: (C a, C b) => a -> b Source #
ringPower :: (C a, C b) => b -> a -> a Source #
A prefix function of (^)
with a parameter order that fits the needs of partial application
and function composition.
It has generalised exponent.
See: Argument order of expNat
on
http://www.haskell.org/pipermail/haskell-cafe/2006-September/018022.html
fieldPower :: (C a, C b) => b -> a -> a Source #
A prefix function of (^-)
.
It has a generalised exponent.