Mon, 7 Aug 2000 17:58:40 -0700, Sigbjorn Finne <[EMAIL PROTECTED]> pisze:

> Here's a Prelude inconsistency that's been irking me once 
> in a while for a loong time - today it came up again, so here goes:
> 
>   unlines   ["a","b"]   ==> "a\nb\n"
>   unwords ["a","b"]   ==> "a b"

IMHO it should be that way. Because text files generally do have
the final '\n', but lines don't have a final space. Spaces are word
separators, '\n' are line terminators.

When I map each line of the file, I don't expect dealing with a final
empty line.

unlines a ++ unlines b = unlines (a++b)

> I'd find it a little more useful without the trailing \n
> (esp. considering now that putStrLn is std.)

writeFile "foo" (unlines listOfLines)
Using putStrLn here would be less convenient.

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK


Reply via email to