
Hello,
Anyway, my understanding from this thread is:
- Data.ByteString.Char8 does not have performance penalty. So, we can use the character literal (e.g. 'H') with it for code readability.
- But the utility functions in Data.Char is slow because it handles Unicode. So, we need faster utility functions specialized to Char.
Is this correct? Should I implement the char8 library (or include Data.Char8 in the word8 library)?
I know that Greg dislikes to have extra libraries but I think that sharing utility functions is a good thing.
Sounds correct to me. The only thing that's needed as far as I can tell is specialized-to-ascii toUpper and toLower.
I added Data.Char8 to the word8 library and released word8 v0.0.1. To my tiny benchmark, toLower of Data.Char8 is 5x faster than that of Data.Char. Is this fast enough? If you are interested in, please review the code or measure performance. Its repo is: https://github.com/kazu-yamamoto/word8.git --Kazu