2010/8/13 Bryan O'Sullivan <bos@serpentine.com>
2010/8/13 Gábor Lehel <illissius@gmail.com>If you know it's text and not binary data you are working with, you should still use Data.Text. There are a few good reasons.ByteString again?How about the case for text which is guaranteed to be in ascii/latin1?
- The API is more correct. For instance, if you use Text.toUpper on a string containing latin1 "ß" (eszett, sharp S), you'll get the two-character sequence "SS", which is correct. Using Char8.map Char.toUpper here gives the wrong answer.
- In many cases, the API is easier to use, because it's oriented towards using text data, instead of being a port of the list API.
- Some commonly used functions, such as substring searching, are way faster than their ByteString counterparts.