Closed bjornbm closed 5 years ago
I don't see why this would be a problem, as the character has been around forever and has a low codepoint. The only potential issue might be with the zaniness of console output on Windows, I will try it.
This has a significant effect on doctests, but I am writing some comments to warn of it and powering through because I think it is valuable.
👍
Is the impact that the doctest author must remember to put a non-breaking space in the reference output (if handwritten)? Or something more (doctest
parser breaking or something??)?
Primarily the former, although there is a single one that I am having trouble fixing that way, for a reason that is currently perplexing me (but may have to do with the escaping behavior of the show instance for strings).
The strange one used showIn
and then the result line had a quoted string that would have resulted from the Show
instance for String
. I added an explicit putStrLn
.
For what it's worth I got a successful doctest with:
-- >>> showIn watt $ (37 *~ volt) * (4 *~ ampere)
-- "148.0\160W"
Doesn't that work on you system?
I had put in an actual non-breaking space, not an escaped one. I got a complaint where the expected version had "\"148.0\160W\""
and the actual version had "\"148.0\\160W\""
(or vice versa). I decided the putStrLn
version seemed cleaner.
I try to always use non-breaking spaces between the numerical value and the unit symbol when I write. Would be nice to have that in dimensional too but don't know if it may cause any headaches?
Would also apply to the space in, for example, “° s^-1”, if applicable.