On Fri, Sep 21, 2012 at 5:11 AM, Kazu Yamamoto <kazu@iij.ad.jp> wrote:
Hello,
> - Data.ByteString.Char8 has no performance penalty: "w2c" uses
> Ignoring this, I think I can summarize:
>
> "unsafeChr" which is a no-op, and GHC.Word has a RULES pragma making the> - for some reason GHC is generating worse code for the Word8 versions of
> "fromIntegral" also free (it's a narrow8Word#)
> toLower than it is for the Char equivalents> - consequently, there seems to be no reason to use the word8 library:
> not only is it not faster, it's actually a pessimization.My dictionary does not have the word "pessimization". Would you explain
what do you want to say with other words?
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.