foldr :: (a -> r -> a) -> a -> [r] -> a foldr g h l = case l of x : xs -> g x (foldr g h xs) [] -> h sum = foldr ( \ x y -> x + y ) 0 length = product =