There are already methods for cut in CategoricalArrays that accept breaks. If you need both range checking on the breaks and the categorical array, you could create a higher level type that knows both and provides the combined functionality.
There are already methods for cut in CategoricalArrays that accept breaks. If you need both range checking on the breaks and the categorical array, you could create a higher level type that knows both and provides the combined functionality.