[Haskell-cafe] returning lists

raptor raptor at tvskat.net
Thu Dec 1 17:39:02 EST 2005


|
|A good start is to write a function which returns the first split, as
|well as the remainder of the string as a tuple.
|Then you can use this function over and over on the remainder of each
|call until it is "".

]- that is the problem :"), 'cause such functions should accept
Char and String, but return a Tuple of Strings, but it is recursive (so that it
fetch next,next,next char :)) i.e. it is own "consumer" and should return String

--this is wrong, just tring
grab char (x:xs)
        | x /= char = (x : grab char xs, xs)
        | otherwise = ([],[])


More information about the Haskell-Cafe mailing list