[Haskell-cafe] "Best practices" for Text

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Mon Nov 8 03:34:14 EST 2010

With the recent discussions on the libraries mailing list about the
API of Bryan O'Sullivan's text library, and the fact that I'm looking
at using it soon for the first time, are there any recommended best
practices or tips & tricks people have come up with?

For starters, I'm considering writing a polyparse [1] instance for
Text.  However, even with the current Bytestring instances for
polyparse there seems to be an emphasis on character-based parsing.
Is that the correct way of doing things?  For example, what would be
the best way to try to parse a text value when you don't care about
case?  At the moment, with my String-based parser, I'm doing repeated
comparisons on Char values [2,3].

[1]: http://hackage.haskell.org/package/polyparse
[2]: http://hackage.haskell.org/packages/archive/graphviz/2999.10.0.1/doc/html/src/Data-GraphViz-Parsing.html#character
[3]: http://hackage.haskell.org/packages/archive/graphviz/2999.10.0.1/doc/html/src/Data-GraphViz-Parsing.html#string

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list