Subscribe to
Posts
Comments

Earlier this evening, I released a new version of the Haskell text package. This one adds support for I/O, which in previous releases you had to roll by hand. The Data.Text.IO and Data.Text.Lazy.IO modules are the places you'll want to look for details of how to read and write text easily.

The reason for this timing was that GHC 6.12.1 was released today, and its newly reworked I/O code includes thorough support for character set and line ending conversion. If you are using the text package on an older version of GHC, it will use UTF-8 encoding and the platform's native line ending mode. On 6.12 and above, the text package obeys the current settings for a given handle.

I still have some performance tuning to do with the lazy I/O code, but it works quite nicely right now. Enjoy!

2 Responses to “Data.Text 0.7 gains I/O support”

  1. on 16 Dec 2009 at 02:17solrize

    Yay! Data.Text (even before this addition) has been one of the important missing pieces of Haskell for a while. Keep up the good work.

  2. on 19 Dec 2009 at 23:10Isaac Dupree

    It looks like the haddocs in the “lazy” module (e.g. readFile) say that the functions are strict. Mistake?

Leave a Reply