We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems to me that these lines in Data.String.CodePoints.uncons
Data.String.CodePoints.uncons
purescript-strings/src/Data/String/CodePoints.purs
Lines 197 to 198 in 157e372
are first slicing the first code unit into a Char string with the JavaScript charAt method
Char
charAt
purescript-strings/src/Data/String/Unsafe.js
Line 5 in 157e372
and then converting the Char string to a CodePoint by the boundedEnumChar instance fromEnum method which calls the Javascript charCodeAt method.
CodePoint
boundedEnumChar
fromEnum
charCodeAt
https://github.com/purescript/purescript-enums/blob/170d959644eb99e0025f4ab2e38f5f132fd85fa4/src/Data/Enum.js#L4
We could skip the intermediate string slice of the charAt method and call charCodeAt directly.
The text was updated successfully, but these errors were encountered:
Is it doing that because it makes it easier on other backends?
Sorry, something went wrong.
Maybe. That's a good point.
I tried swapping in a “fast” CodePoints.uncons function in purescript-parsing and couldn't detect any speedup.
CodePoints.uncons
No branches or pull requests
It seems to me that these lines in
Data.String.CodePoints.uncons
purescript-strings/src/Data/String/CodePoints.purs
Lines 197 to 198 in 157e372
are first slicing the first code unit into a
Char
string with the JavaScriptcharAt
methodpurescript-strings/src/Data/String/Unsafe.js
Line 5 in 157e372
and then converting the
Char
string to aCodePoint
by theboundedEnumChar
instancefromEnum
method which calls the JavascriptcharCodeAt
method.https://github.com/purescript/purescript-enums/blob/170d959644eb99e0025f4ab2e38f5f132fd85fa4/src/Data/Enum.js#L4
We could skip the intermediate string slice of the
charAt
method and callcharCodeAt
directly.The text was updated successfully, but these errors were encountered: