
29 Jul
2004
29 Jul
'04
10:44 a.m.
Simon Marlow wrote:
How about: split :: (a -> Bool) -> [a] -> [[a]]
I would not mind if you put it into Data.List (although I would need to change some code that I've copied from elsewhere) It's the libraries's writer privilege to choose (short) names.
Unfortunately
lines /= split (=='\n')
because lines strips off blank lines at the end.
Only the last newline is ignored: lines "\na\nb\n\n" = ["","a","b",""] Thus, it behaves in the same way as splitPS (arguably this is maybe not a bug) Christian