This is the program I have written to add a list of list of elements which may contain either a float or an integer. Doesn't seem to work at all and my lecturer is as clueless about this as I am and I cant find an appropriate solution for this, have tried list comprehension however most of the examples use direct inputs to the GHC not IO() programs. Also trying to use HOF(higher order functions) as evident by the function "summ".
conc :: Num a => [[a]] -> [a]
conc [] = []
conc xss = [x | xs <- xss , x <- xs]
summ :: ([[a]] -> [a]) -> [[a]] ->[a]
summ [[f]] [[s]] = f (s)
summ (h : t) = h + summ t
summer :: IO()
summer = do
putStr "Enter a List of List (Int/Float): "
li <- getLine
let li = (read li) :: [[Float]]
let r = summ (conc li)
putStrLn "Sum of the list of lists is: " ++ r
So i solved my own question for those stuck with the same problem here is the solution.