let chooseFunction use union case directly