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.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to