support reduction along dimension for foldl