@@ -236,9 +236,12 @@ mapMaybe f (x::xs) =
237--------------------------------------------------------------------------------
237--------------------------------------------------------------------------------
239+total foldrImpl : (t -> acc -> acc) -> acc -> (acc -> acc) -> List t -> acc
240+foldrImpl f e go [] = go e
241+foldrImpl f e go (x::xs) = foldrImpl f e (go . (f x)) xs
239instance Foldable List where
243instance Foldable List where
240− foldr f e [] = e
244+ foldr f e xs = foldrImpl f e id xs
241− foldr f e (x::xs) = f x (foldr f e xs)
243--------------------------------------------------------------------------------
246--------------------------------------------------------------------------------
244-- Special folds
247-- Special folds