Add safeCast for Coproduct