NewlineMode

Specifies the translation, if any, of newline characters between internal Strings and the external file or stream. Haskell Strings are assumed to represent newlines with the '\n' character; the newline mode specifies how to translate '\n' on output, and what to translate into '\n' on input.
Specifies the translation, if any, of newline characters between internal Strings and the external file or stream. Haskell Strings are assumed to represent newlines with the '\n' character; the newline mode specifies how to translate '\n' on output, and what to translate into '\n' on input.
Set the NewlineMode on the specified Handle. All buffered data is flushed first.
Use the native newline representation on both input and output
nativeNewlineMode  = NewlineMode { inputNL  = nativeNewline
outputNL = nativeNewline }
Map '\r\n' into '\n' on input, and '\n' to the native newline representation on output. This mode can be used on any platform, and works with text files using any newline convention. The downside is that readFile >>= writeFile might yield a different file.
universalNewlineMode  = NewlineMode { inputNL  = CRLF,
outputNL = nativeNewline }