Implement unions and intersections.