ginger
ginger copied to clipboard
Use Text instead of String in parser
String is not fast nor memory efficient, Text is better in almost every case.
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
Textinstead ofStringas well) - Rename the
Text-based API, and provide a compatibility shim forString - Perform some typeclass voodoo to make the parser support both
I'll give this some more thought, any input on the matter is welcome.
Personally, I'm +1 on hard breakage, forgetting String altogether and a major version bump with a clear note in the changelog.