
4 Sep
2009
4 Sep
'09
7:40 p.m.
Hi Serge, Serge LE HUITOUZE wrote:
I'm asking some advice on a small piece of code representing a simplified version of a treatment I need to perform. I have a line-oriented string/file, from which I want to extract only a substring of those lines starting with char '+' (the detail of the extraction is irrelevant here, I'll just return what follows the '+').
This isn't really answering your question, but I thought I'd share anyway: why use Parsec to retrieve those lines? It seems a simple function is a lot easier: selectPlus :: String -> [String] selectPlus = map tail . filter ((== '+') . head) . lines I hope this helps you. Martijn.