fix foldr fn arg order and its tests