numeric-prelude-0.4.2: An experimental alternative hierarchy of numeric type classes

Number.Root

Synopsis

Documentation

data T a Source

The root degree must be positive. This way we can implement multiplication using only multiplication from type `a`.

Constructors

 Cons Integer a

Instances

 Functor T When you use `fmap` you must assert that `forall n. fmap f (Cons d x) == fmap f (Cons (n*d) (x^n))` (Eq a, C a) => Eq (T a) (Ord a, C a) => Ord (T a) Show a => Show (T a)

fromNumber :: a -> T a Source

toNumber :: C a => T a -> a Source

toRootSet :: C a => T a -> T a Source

commonDegree :: C a => T a -> T a -> T (a, a) Source

mul :: C a => T a -> T a -> T a Source

div :: C a => T a -> T a -> T a Source

recip :: C a => T a -> T a Source

cardinalPower :: C a => Integer -> T a -> T a Source

exponent must be non-negative

integerPower :: C a => Integer -> T a -> T a Source

exponent can be negative

rationalPower :: C a => Rational -> T a -> T a Source

root :: C a => Integer -> T a -> T a Source

exponent must be positive

sqrt :: C a => T a -> T a Source