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

Use Text instead of String in parser #51

Open
poscat0x04 opened this issue Jun 14, 2020 · 2 comments
Open

Use Text instead of String in parser #51

poscat0x04 opened this issue Jun 14, 2020 · 2 comments

Comments

@poscat0x04
Copy link
Contributor

String is not fast nor memory efficient, Text is better in almost every case.

@tdammers
Copy link
Owner

The reason for this is because when I started developing Ginger, Parsec didn't accept Text as its input yet. I agree that Text would be the correct choice here, and I have a patch ready in the string-to-text branch, but I'm mildly undecided about how to handle the resulting breaking change. Options:

  • Just apply the patch as is, introducing a hard breaking change (i.e., users will have to change their code to use Text instead of String as well)
  • Rename the Text-based API, and provide a compatibility shim for String
  • Perform some typeclass voodoo to make the parser support both

I'll give this some more thought, any input on the matter is welcome.

@mulderr
Copy link
Contributor

mulderr commented Nov 10, 2021

Personally, I'm +1 on hard breakage, forgetting String altogether and a major version bump with a clear note in the changelog.

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

No branches or pull requests

3 participants