Is there a function that extracts the index from an element of a CategoricalArray created by the function `cut`?

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.