Define the function normalizes that given a polynomial, it returns the corresponding polynomial, after being normalized.
Example:
normaliza [(1,2),(3,4),(3,2)]
[(4,1),(3,4)]
type Polinomio = [Monomio]
type Monomio = (Float,Int)
normaliza :: Polinomio -> Polinomio
normaliza [(x,y)] = [(x,y)]
normaliza ((x,y): t) = (map (+) coeficientes (selgrau y (x,y):t)) ((x,y) : t)
coeficientes :: [(Float,Int)] -> [Float]
coeficientes [(x,y)] = [x]
coeficientes (h:t) = fst h : coeficientes t
selgrau :: Int -> Polinomio -> Polinomio
selgrau n [] = []
selgrau n l = filter f l
where f (c,e) = e == n
Can you help me :)