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

Safe HaskellNone

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) 

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

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

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

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

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

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

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

exponent must be non-negative

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

exponent can be negative

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

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

exponent must be positive

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