I\'ve designed a function to compute the mean of a list. Although it works fine, but I think it may not be the best solution due to it takes two functions rather than one. Is it
Your solution is good, using two functions is not worse than one. Still, you might put the tail recursive function in a where clause.
where
But if you want to do it in one line:
calcMeanList = uncurry (/) . foldr (\e (s,c) -> (e+s,c+1)) (0,0)