Arbitrary Strings Not Properly Encodable.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- testing
Research direction
Start by locating the Arbitrary instances for strings and characters in the repository, then inspect how generated UTF-16 code units are used by the existing tests. The issue proposes generating strings from code points or restricting the character range to U+0000–U+D7FF; determine which approach fits the library and verify the encoding behavior with the reported text encoding work.
Written by the indexing model from the issue text.
Description
Hi Folks, I have ongoing work to deal with string encoding for the purpose of supporting cryptography in purescript, and I am attempting to isolate the cause of the problem I encounter.
I suspect currently that the cause of the problem is actually in the way that quickcheck generates strings via Arbitrary. That is to say, that generating randomly ordered CodeUnits (purescript Char), is not truly compliant with the way UTF-16 strings should be encoded. If we wanted to join randomly generated strings, these should be the (potenitially) multi code-unit strings, aka CodePoints.
I think the best solution would be to redefine arbitrary string such that it is generated from Code Points, not Code Units. Failing this however, a "quick and dirty" solution would be to redefine the char range used to generate strings to always fall within the U+0000 to U+D7FF range. (Represented identically between their code point and code unit).
I will be happy over the weekend to write the PR should I find time and there are no objections raised here. It will also be used to verify my theory by using it with existing text encoding work I've done.
- Dominant language
- PureScript
- Stars
- 108
- Forks
- 42
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from purescript/purescript-quickcheck
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
purescript/purescript-quickcheck#136 · 1 comment ·
-
Lazy List Arbitrary InstancePossibly taken @eviefp claimed this 2206 days ago. Opentype: enhancement
Difficulty 3/5 1-2 days Newbie friendliness 20/100
purescript/purescript-quickcheck#111 · 2 comments · 2 reactions ·
-
type: documentation
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
purs-0.15 type: breaking change
Difficulty 5/5 Over a week Newbie friendliness 20/100
purescript/purescript-quickcheck#104 · 12 comments ·
-
ShrinkingOpentype: enhancement
Difficulty 5/5 Over a week Newbie friendliness 15/100
purescript/purescript-quickcheck#103 · 6 comments · 4 reactions ·
All issues in purescript/purescript-quickcheck
Similar issues
-
[prefer-expect-resolves] autofix leaves a stray ")" when the awaited expression is parenthesizedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jest-community/eslint-plugin-jest#2052 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
johanhaleby/occurrent#1505 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jeanibarz/knowledge-base-mcp-server#1262 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
future-agi/future-agi#4092 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day