Skip to content

Address toString_Word issue in WASM FFI.#1440

Merged
dmjio merged 1 commit into
masterfrom
word-ffi-wasm
Feb 26, 2026
Merged

Address toString_Word issue in WASM FFI.#1440
dmjio merged 1 commit into
masterfrom
word-ffi-wasm

Conversation

@dmjio
Copy link
Copy Markdown
Owner

@dmjio dmjio commented Feb 26, 2026

foreign import javascript unsafe "return ($1).toString()"
  toString_Word :: Word -> JSString

^ This causes overflowing where none should happen.

ghci> ms (4000000000 :: Word)
"-294967296"

Revert to using ms . show

N.B. the JS backend does exhibit the same behavior for ToMisoString Word

```haskell
foreign import javascript unsafe "return ($1).toString()"
  toString_Word :: Word -> JSString
```

^ This causes overflowing where none should happen.

```
ghci> ms (4000000000 :: Word)
"-294967296"
```
@dmjio dmjio merged commit d6735bb into master Feb 26, 2026
2 checks passed
@dmjio dmjio deleted the word-ffi-wasm branch February 26, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant