lines package:Stream

The lines function breaks a stream of characters into a list of strings at newline characters. The resulting strings do not contain newlines. Beware: if the stream of characters xs does not contain newline characters, accessing the tail of lines xs will loop.
The unlines function is an inverse operation to lines. It joins lines, after appending a terminating newline to each.