purescript/purescript-strings

Remove bounds check and exception from Data.String.Unsafe foreign code?

Opened this issue · 3 comments

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.

I don't see Data.Char.Unsafe. Did you mean Data.String.Unsafe?

Yes, sorry.

This sounds good. Also, this will allow us to redefine char as export const char = charAt(0);.