Polynomials in a countably infinite set of variables x1, x2, x3, ...

- newtype T a = Cons [T a]
- fromMonomials :: [T a] -> T a
- lift0 :: [T a] -> T a
- lift1 :: ([T a] -> [T a]) -> T a -> T a
- lift2 :: ([T a] -> [T a] -> [T a]) -> T a -> T a -> T a
- x :: C a => Integer -> T a
- constant :: a -> T a
- compose :: (C a, C a) => T a -> T a -> T a
- merge :: Ord a => Bool -> (a -> a -> a) -> [a] -> [a] -> [a]

# Type

A polynomial is just a list of monomials, construed as their sum. We maintain the invariant that polynomials are always sorted by the ordering on monomials defined in MathObj.Monomial: first by partition degree, then by largest variable index (decreasing), then by exponent of the highest-index variable (decreasing). This works out nicely for operations on cycle index series.

Instances are provided for Additive, Ring, Differential (partial differentiation with respect to x1), and Show.

# Constructing polynomials

fromMonomials :: [T a] -> T aSource