module PRO where
average1 :: IO Float
avarage1 =
do
putStrLn "Enter Marks in Form of a List"
marks <- getLine
let m = (read marks)::[Int]
x<-(sum' (m))
avg <- x/length (m)
if(x/=[])
then
putStrLn ("empty List")
else
putStrLn ("Your Avarage is " ++ show(avg))
sum' :: (Num a) => [a] -> a
sum' xs = foldl (\acc x -> acc + x) 0 xs
My program doesn't seems to work! My question is why can't I assign avg the returning sum of the sum' function?