generalizations on pair operations