[Haskell-cafe] Split function

C K Kashyap ckkashyap at gmail.com
Wed Feb 9 08:07:40 CET 2011


Hi,

Is this a good implementation of split function? ... I was wondering about
the "lines" function, it basically a special case of split right?

split c xs = foldr f [[]] xs
where
f x list@(l:ls)= if x == c then []:list else (x:l):ls


Regards,
Kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110209/a93863f7/attachment.htm>


More information about the Haskell-Cafe mailing list