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


Udo.
-- 
"Money can't buy friends, but it can get you a better class of enemy."
        -- Spike Milligan

Attachment: signature.asc
Description: Digital signature

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

Reply via email to