toValue for set types