Skip to content

Fix unfelicities in docs for lines, unlines, words, unwords

Koz Ross requested to merge kozross/ghc:koz/amend-lines-unlines-docs into master

This is a follow-on from this merge request. Essentially, the documentation for lines, unlines, words, and unwords suffers from multiple infelicities:

  • Both unlines and unwords claim to be 'inverses'. This is 100% incorrect, even based on the given examples, and is needlessly confusing.
  • lines mentions 'newline characters', which is not a meaningful thing. You can talk about LF characters, or newlines, but a newline is not necessarily a single character (Windows users would certainly claim it's two), and LFs are not the only characters that comprise newlines (again, Windows users would like themselves heard).
  • words talks about 'whitespace', without spelling out what precisely that means. It's also very scant on detail of significance to its operation, forcing reading of its source code for clarity, which should ideally never be necessary for a user.

This MR fixes all of the above, by giving precise wording, and counter-examples, and avoiding terms of unclear meaning.


Tracking: #17929

Edited by Hécate Moonlight

Merge request reports