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

Make Str.fromUtf8 return a record #1020

Open
jaredramirez opened this issue Feb 21, 2021 · 2 comments · May be fixed by #7321
Open

Make Str.fromUtf8 return a record #1020

jaredramirez opened this issue Feb 21, 2021 · 2 comments · May be fixed by #7321
Assignees
Labels
builtins Relates to roc builtins like Bool, List, Str ... enhancement New feature or request

Comments

@jaredramirez
Copy link
Contributor

Current, Str.fromUtf8's type signature is List U8 -> Result Str [ BadUtf8 Utf8ByteProblem Nat ]*. A possible problem with this is without reading the documentation it's unclear what Nat is supposed to be here. To clear this up, the signature could be List U8 -> Result Str [ BadUtf8 { problem : Utf8ByteProblem index : Nat } ]* to indicate that Nat is the index of the byte that failed.

@skyqrose
Copy link
Collaborator

This issue still exists

fromUtf8 : List U8 -> Result Str [BadUtf8 Utf8ByteProblem U64]

@skyqrose skyqrose added enhancement New feature or request builtins Relates to roc builtins like Bool, List, Str ... labels Nov 11, 2024
@shua
Copy link
Contributor

shua commented Dec 7, 2024

I can take this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins Relates to roc builtins like Bool, List, Str ... enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants