Implement union and intersection types