showPolynomial (Polynomial p) = show' p' where
    show' [] = ""
    show' [m] = show m
    show' (m:ms) = (show m `beside` " +" )`beside` show' ms
    dim = dimension (Polynomial p)
    nonZero = filter (\m -> coeff m /= zeros dim dim && coeff m /= zeros dim 1) p
    p' | nonZero == [] = [zero dim]
       | otherwise = nonZero

{-
constant :: Monomial -> Bool
constant m | vars m == [] = True
           | otherwise    = False
-}
showPolynomial (Polynomial p) = show' p' where
    show' [] = ""
    show' [m] = show m
    show' (m:ms) = (show m `beside` " +" )`beside` show' ms
    dim = dimension (Polynomial p)
    nonZero = filter (\m -> coeff m /= zeros dim dim && coeff m /= zeros dim 1) p
    p' | nonZero == [] = [zero dim]
       | otherwise = nonZero

{-
constant :: Monomial -> Bool
constant m | vars m == [] = True
           | otherwise    = False
-}
showPolynomial (Polynomial p) = show' p' where
    show' [] = ""
    show' [m] = show m
    show' (m:ms) = (show m `beside` " +" )`beside` show' ms
    dim = dimension (Polynomial p)
    nonZero = filter (\m -> coeff m /= zeros dim dim && coeff m /= zeros dim 1) p
    p' | nonZero == [] = [zero dim]
       | otherwise = nonZero

{-
constant :: Monomial -> Bool
constant m | vars m == [] = True
           | otherwise    = False
-}