foldl using foldr