ginger icon indicating copy to clipboard operation
ginger copied to clipboard

Use Text instead of String in parser

Open poscat0x04 opened this issue 5 years ago • 2 comments

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

poscat0x04 avatar Jun 14 '20 00:06 poscat0x04

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.

tdammers avatar Aug 28 '20 23:08 tdammers

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

mulderr avatar Nov 10 '21 14:11 mulderr