Data/Show.lua showNumberImpl = tostring, but Lua 5.1 tostring does not match PureScript/JS show :: Number -> String:
| value |
PureScript show |
Lua tostring |
| 0.0 |
0.0 |
0 |
| 500.0 |
500.0 |
500 |
| 1e10 |
10000000000.0 |
10000000000 |
| 1/0 |
Infinity |
inf |
| -1/0 |
-Infinity |
-inf |
| 0/0 |
NaN |
-nan |
So integral Numbers lose the .0, and infinities/NaN print Lua spellings. This is the same class as the showString/showArray FFI divergences. It blocks reviving the upstream testNumberShow suite (test/Test/Main.purs), which asserts the PureScript formats.
Fix needs a formatter that adds .0 for integral finite numbers and maps inf/nan to Infinity/-Infinity/NaN (mirroring the upstream JS show). Found while reviving the prelude test suite (closes-with-credit of #2 by @UnrelatedString).
Data/Show.luashowNumberImpl = tostring, but Lua 5.1tostringdoes not match PureScript/JSshow :: Number -> String:0.00500.050010000000000.010000000000Infinityinf-Infinity-infNaN-nanSo integral Numbers lose the
.0, and infinities/NaN print Lua spellings. This is the same class as the showString/showArray FFI divergences. It blocks reviving the upstreamtestNumberShowsuite (test/Test/Main.purs), which asserts the PureScript formats.Fix needs a formatter that adds
.0for integral finite numbers and maps inf/nan to Infinity/-Infinity/NaN (mirroring the upstream JS show). Found while reviving the prelude test suite (closes-with-credit of #2 by @UnrelatedString).