
30 Sep
2006
30 Sep
'06
4:53 p.m.
On Sat, Sep 30, 2006 at 08:51:40PM +0200, Udo Stenzel wrote:
To: Matthias Fischmann
Cc: haskell-cafe@haskell.org From: Udo Stenzel Date: Sat, 30 Sep 2006 20:51:40 +0200 Subject: Re: [Haskell-cafe] cutting long strings into lines Matthias Fischmann wrote:
although this wasn't the original problem, i like it, too :). but now i am stuck in finding an optimal implementation for lines.
Isn't the obvious one good enough?
lines [] = [] lines s = go s where go [] = [[]] go ('\n':s) = [] : lines s go (c:s) = let (l:ls) = go s in (c:l):ls
thanks. good enough, yes. just not obvious to me... (-: matthias