mySum :: Num a => [a]->a mySum lst | null lst = 0 | otherwise = head lst + mySum (tail lst) mySum' :: Num a => [a]->a mySum' [] = 0 mySum' (h:t) = h + mySum' t myMaximum :: Ord a => [a]->a myMaximum [] = error "Maximum of empty list" myMaximum [x] = x myMaximum (h:t) | h >= m = h | otherwise = m where m = myMaximum t -- Polynomial coeff. in descending order polDerivative :: Num a => [a]->[a] polDerivative [] = [] polDerivative [a] = [] polDerivative (h:t) = (fromIntegral(length t) * h) : polDerivative t -- Polynomial coeff. in descending order polAntiderivative :: (Num a, Fractional a) => [a]->[a] polAntiderivative [] = [0] polAntiderivative (h:t) = (h / (fromIntegral(length t) + 1)):polAntiderivative t