[web-devel] Data.Word8 (word8 library)

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Thu Sep 20 10:41:43 CEST 2012


ByteString is an array of Word8 but it seems to me that people tend to
use the Char interface with Data.ByteString.Char8 instead of Word8
interface with Data.ByteString. Since the functions defined in
Data.ByteString.Char8 converts Word8 to Char and Char to Word8, it has
unnecessary overhead. Yes, the overhead is ignorable in many cases,
but I would like to remove it for high performance server.

Why do people use Data.ByteString.Char8? I guess that there are two

- There are no standard utility functions for Word8 such as "isUpper"
- Numeric literal (e.g 72 for 'H') is not readable

To fix these problems, I implemented the Data.Word8 module and
uploaded the word8 library to Hackage:


If Michael and Bas like this, I would like to modify warp and
case-insensitive to use the word8 library. What do people think this?

My concern is that character names start with "_". Some people would
dislike this convention. But I have not a better idea at this moment.
Suggestions are welcome.


More information about the web-devel mailing list