Many Unix/Linux tools expect or require this newline at the end of files. If it's missing, these tools might not be able to process the last line correctly, or they might throw warnings or errors.
The POSIX standard, which defines the core of Unix/Linux operating systems, requires each line to end with a newline character.
Followup on the huge PR I just saw merged: https://github.com/haskell/lsp/pull/478 ( CC @michaelpj) Let's not forget newline at the end of generated files.