Take a look at Data.Text . Anything that uses Prelude lists, such as String s, usually works poorly, especially with features like stripR . Some consider this a mistake of the past because it has infected many (otherwise sensible) interfaces with the inefficiency of using singly linked character lists ( String ) for text data.
The functions you are looking for are in order: dropWhile , dropWhileEnd , dropAround , stripStart , stripEnd , strip .
Please note that there is no special function for deletion based on the equality of characters. You really don't get anything from aliasing dropX with a predicate, unless it is used very often, like Data.Char.isSpace .
user824425
source share