Utilities for implementing unboxed restrictions of arbitrary types