How can you use the latest Attoparsec case-insensitive match strings?

attoparsec 0.72 had this feature, but seems to have disappeared in later versions:

stringTransform :: (ByteString -> ByteString) -> ByteString -> Parser ByteString

"Match the literal string after applying the conversion to both it and the corresponding text. Useful for comparing strings case insensitive."

http://hackage.haskell.org/package/attoparsec-0.7.2/docs/Data-Attoparsec.html

+3
source share
1 answer

Use stringCIfrom Data.Attoparsec.ByteString.Char8. Consider switching to Textif you want the comparison to be in Unicode mode (for example, so that "ß" is considered equal to "ss").

+5
source

All Articles