On Sat, Feb 06, 2010 at 11:12:40PM +1030, Mark Spezzano wrote:
> -- Function: joinLines
> -- Joins the Words within Lines together with whitespace and newline 
> characters
> -- Argument: Lines to pad with whitespace and newlines
> -- Evaluate: The processed and concatenated String
> joinLines :: [Line] -> String
> joinLines (l:[]) = concat (intersperse " " l)
> joinLines (l:ls) = (concat (intersperse " " l)) ++ ('\n':joinLines ls)

Why not just

  joinLines = unlines . map unwords

This should be as fast as you may get using lists of lists of
lists of Chars :).

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

Reply via email to