Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
natefaubion opened this issue Apr 26, 2024 · 3 comments
Open

Comments

@natefaubion
Copy link
Contributor

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.

@michaelficarra
Copy link
Contributor

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

@natefaubion
Copy link
Contributor Author

Yes, sorry.

@natefaubion natefaubion changed the title Remove bounds check and exception from Data.Char.Unsafe foreign code? Remove bounds check and exception from Data.String.Unsafe foreign code? May 1, 2024
@michaelficarra
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants