
20 Sep
2012
20 Sep
'12
5:02 a.m.
On Thu, Sep 20, 2012 at 10:41 AM, Kazu Yamamoto
Why do people use Data.ByteString.Char8? I guess that there are two reasons:
- There are no standard utility functions for Word8 such as "isUpper" - Numeric literal (e.g 72 for 'H') is not readable
The Char8 module was added so that it's easier to work with protocols that mix binary and ASCII data, such as HTTP. Note that Word8 is represented using a full machine word, just like Char, so you're unlikely to get any performance improvements from Word8 in this case (unless GHC fails to simplify e.g. calls to 'ord' and 'chr' in places). -- Johan