
21 Oct
2009
21 Oct
'09
3:25 p.m.
satorisanitarium wrote:
How to make a list of sublists out of a list, whether they be a list of numbers or a string.
Without recursion (with fold) starting from the tail of the input list: foo n = foldr st [[]] where st x xss | x == n = [x]:xss st x (xs:xss) = (x:xs):xss -- View this message in context: http://www.nabble.com/list--%3E-sublists-tp25975341p25998649.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.