You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
showNumberImpl uses Lua tostring — wrong format vs PureScript show (0.0, NaN, Infinity, exponents) #9
Data/Show.luashowNumberImpl = 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).
Activity
Unisay commentedon Jun 15, 2026
Fixed in v7.3.0: showNumberImpl emits NaN/Infinity/-Infinity and a trailing .0 on integral Numbers. Verified under Lua 5.1.