I am trying to do some simple text processing in Haskell, and I am wondering what might me the best way to go about this in an FP language. I looked at the parsec module, but this seems much more sophisticated than I am looking for as a new Haskeller. What would be the best way to strip all the punctuation from a corpus of text? My naive approach was to make a function like this:
removePunc str = [c | c <- str, c /= '.',
c /= '?',
c /= '.',
c /= '!',
c /= '-',
c /= ';',
c /= '\'',
c /= '\"',]
You can simply write your code:
or