add polymorphic cons operation