attoparsec 0.72 had this function but it seems to have disappeared in later versions:
stringTransform :: (ByteString -> ByteString) -> ByteString -> Parser ByteString
"Match a literal string, after applying a transformation to both it and the matching text. Useful for e.g. case insensitive string comparison."
http://hackage.haskell.org/package/attoparsec-0.7.2/docs/Data-Attoparsec.html
Use stringCI
from Data.Attoparsec.ByteString.Char8
. Consider switching to Text
if you want the comparison to be Unicode-aware (e.g. so that "ß" is treated as equal to "ss").