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

Safe HaskellNone
LanguageHaskell98

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 Source #

When you use fmap you must assert that forall n. fmap f (Cons d x) == fmap f (Cons (n*d) (x^n))

Instance details

Defined in Number.Root

Methods

fmap :: (a -> b) -> T a -> T b #

(<$) :: a -> T b -> T a #

(Eq a, C a) => Eq (T a) Source # 
Instance details

Defined in Number.Root

Methods

(==) :: T a -> T a -> Bool #

(/=) :: T a -> T a -> Bool #

(Ord a, C a) => Ord (T a) Source # 
Instance details

Defined in Number.Root

Methods

compare :: T a -> T a -> Ordering #

(<) :: T a -> T a -> Bool #

(<=) :: T a -> T a -> Bool #

(>) :: T a -> T a -> Bool #

(>=) :: T a -> T a -> Bool #

max :: T a -> T a -> T a #

min :: T a -> T a -> T a #

Show a => Show (T a) Source # 
Instance details

Defined in Number.Root

Methods

showsPrec :: Int -> T a -> ShowS #

show :: T a -> String #

showList :: [T a] -> ShowS #

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 #