
29 Jul
2004
29 Jul
'04
10:32 a.m.
Simon Marlow writes:
split :: (a -> Bool) -> [a] -> [[a]]
tokens :: (a -> Bool) -> [a] -> [[a]]
Unfortunately, neither function would help me solve my \r\n-line-ending case. I need separators that are longer than one "character". I also think the idea of being able to use the full "current prefix" for the decision is important. I can't use these function, because they would, for example, erroneously split the string "abc\ndef". So far, I like the breakWhere function Ketil proposed best. Peter