module PreludeList where
-- foldr, foldr1, scanr, and scanr1 are the right-to-left duals of the
-- above functions.
foldr :: (a -> b -> b) -> b -> [a] -> b
foldr f z [] = z
foldr f z (x:xs) = f x (foldr f z xs)
reverse [] = []
reverse (x:xs) = reverse xs ++ [x]
--[] ++ ys = ys
--(x:xs) ++ ys = x : (xs ++ ys)
--build_n :: ([c] -> [c]) -> [c]
--build_n g = g []