numeric-prelude-0.0.5: An experimental alternative hierarchy of numeric type classesSource codeContentsIndex
Algebra.ToInteger
Synopsis
class (C a, C a) => C a where
toInteger :: a -> Integer
fromIntegral :: (C a, C b) => a -> b
ringPower :: (C a, C b) => b -> a -> a
fieldPower :: (C a, C b) => b -> a -> a
Documentation
class (C a, C a) => C a whereSource

The two classes C and Algebra.ToRational.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.RealField. With the instances for Float and Double we acknowledge that these types actually represent rationals rather than (approximated) real numbers. However, this contradicts to the Algebra.Transcendental.C instance.

Methods
toInteger :: a -> IntegerSource
show/hide Instances
fromIntegral :: (C a, C b) => a -> bSource
ringPower :: (C a, C b) => b -> a -> aSource

A prefix function of '(Algebra.Ring.^)' 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 -> aSource
A prefix function of '(Algebra.Field.^-)'. It has a generalised exponent.
Produced by Haddock version 2.6.0