I think the bounds check and the exception are largely unnecessary. Presumably one would be using these APIs if they had already performed the requisite checks. If one wanted an exception (rather than undefined behavior), then there is unsafeJust
on the safe API.