
16 Jan
2008
16 Jan
'08
6 p.m.
Hello Haskellers, An often requested function is 'split', to split a list into parts delimited by some separator. ByteString has the functions split and splitWith for this purpose. I propose we add equivalents to Data.List:
split :: Eq a => a -> [a] -> [[a]] split x = splitWith (x==)
splitWith :: (a -> Bool) -> [a] -> [[a]] splitWith p xs = ys : case zs of [] -> [] _:ws -> splitWith p ws where (ys,zs) = break p xs
trac: http://hackage.haskell.org/trac/ghc/ticket/2048 deadline: two weeks from now, January 30 Twan