[GHC] #9816: Add function for size-checked conversion of Integral types