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]
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.
Plethyistic substitution: F o G = F(G(x1,x2,x3...), G(x2,x4,x6...), G(x3,x6,x9...), ...) See Bergeron, Labelle, and Leroux, "Combinatorial Species and Tree-Like Structures", p. 43.