ideas-math-types-1.1: Common types for mathematical domain reasoners

Maintainer bastiaan.heeren@ou.nl provisional portable (depends on ghc) Safe Haskell2010

Domain.Math.Data.Polynomial

Description

Synopsis

# Documentation

data Polynomial a Source #

Instances
 Source # Instance detailsDefined in Domain.Math.Data.Polynomial Methodsfmap :: (a -> b) -> Polynomial a -> Polynomial b #(<\$) :: a -> Polynomial b -> Polynomial a # Source # Instance detailsDefined in Domain.Math.Data.Polynomial Methodsfold :: Monoid m => Polynomial m -> m #foldMap :: Monoid m => (a -> m) -> Polynomial a -> m #foldr :: (a -> b -> b) -> b -> Polynomial a -> b #foldr' :: (a -> b -> b) -> b -> Polynomial a -> b #foldl :: (b -> a -> b) -> b -> Polynomial a -> b #foldl' :: (b -> a -> b) -> b -> Polynomial a -> b #foldr1 :: (a -> a -> a) -> Polynomial a -> a #foldl1 :: (a -> a -> a) -> Polynomial a -> a #toList :: Polynomial a -> [a] #null :: Polynomial a -> Bool #length :: Polynomial a -> Int #elem :: Eq a => a -> Polynomial a -> Bool #maximum :: Ord a => Polynomial a -> a #minimum :: Ord a => Polynomial a -> a #sum :: Num a => Polynomial a -> a #product :: Num a => Polynomial a -> a # Source # Instance detailsDefined in Domain.Math.Data.Polynomial Methodstraverse :: Applicative f => (a -> f b) -> Polynomial a -> f (Polynomial b) #sequenceA :: Applicative f => Polynomial (f a) -> f (Polynomial a) #mapM :: Monad m => (a -> m b) -> Polynomial a -> m (Polynomial b) #sequence :: Monad m => Polynomial (m a) -> m (Polynomial a) # (Eq a, Num a) => Eq (Polynomial a) Source # Instance detailsDefined in Domain.Math.Data.Polynomial Methods(==) :: Polynomial a -> Polynomial a -> Bool #(/=) :: Polynomial a -> Polynomial a -> Bool # (Eq a, Num a) => Num (Polynomial a) Source # Instance detailsDefined in Domain.Math.Data.Polynomial Methods(+) :: Polynomial a -> Polynomial a -> Polynomial a #(-) :: Polynomial a -> Polynomial a -> Polynomial a #(*) :: Polynomial a -> Polynomial a -> Polynomial a #negate :: Polynomial a -> Polynomial a #abs :: Polynomial a -> Polynomial a #signum :: Polynomial a -> Polynomial a # (Eq a, Show a, Num a) => Show (Polynomial a) Source # Instance detailsDefined in Domain.Math.Data.Polynomial MethodsshowsPrec :: Int -> Polynomial a -> ShowS #show :: Polynomial a -> String #showList :: [Polynomial a] -> ShowS # (Eq a, Arbitrary a, Num a) => Arbitrary (Polynomial a) Source # Instance detailsDefined in Domain.Math.Data.Polynomial Methodsshrink :: Polynomial a -> [Polynomial a] # (Eq a, Fractional a) => SafeDiv (Polynomial a) Source # Instance detailsDefined in Domain.Math.Data.Polynomial MethodssafeDiv :: Polynomial a -> Polynomial a -> Maybe (Polynomial a) Source #

toPolynomial :: (Eq a, Num a) => [a] -> Polynomial a Source #

fromPolynomial :: (Eq a, Num a) => Polynomial a -> [a] Source #

var :: (Eq a, Num a) => Polynomial a Source #

con :: (Eq a, Num a) => a -> Polynomial a Source #

raise :: (Eq a, Num a) => Int -> Polynomial a -> Polynomial a Source #

Raise all powers by a constant (discarding negative exponents)

degree :: (Eq a, Num a) => Polynomial a -> Int Source #

coefficient :: (Eq a, Num a) => Int -> Polynomial a -> a Source #

isRoot :: (Eq a, Num a) => Polynomial a -> a -> Bool Source #

eval :: (Eq a, Num a) => Polynomial a -> a -> a Source #