Hii have a problem in my code!here is my code:-- Baic I/O and Loop (50 Points)evalpoly = do putStr "What is the degree of polynomial: "degree <- getLinecoeffs <- (funcOfCoeff ((read degree::Int)+1) [])putStr "What value do you want to evaluate at: "value <- getLineputStr "The value of the polynomial is: "putStr (show (polyEvaluate (coeffs) (read value :: Float) ))putStr "\n"--function loop to get coefficient--funcOfCoeff 0 coeffs = do --to check the degree of 0return coeffs --return list of coefficientfuncOfCoeff degree coeffs = doputStr ("What is the x^" ++ show(degree-1))putStr " coefficient: "coeff <- getLineloop <- funcOfCoeff (degree-1) ((read coeff :: Int) : coeffs)return looppolyEvaluate (coeffs) x = dopowers <- zip coeffs (iterate (+1) 0)result <- map (\(a,b)-> a+b) powers —PROBLEM IS HERE!!!!return resulthere is error message:in very bottom function (polyEvaluate), why is not working “result <- map (\(a,b) -> a+b) powers” ???in Prelude, it is workingThanks!
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners