When returning an unboxed tuple in the javascript FFI, wrapping is expected from the JS code, even for JSRef. This is not done correctly everywhere, and is a source for confusion.
I'd like to change the convention to the following:
Allow unboxed tuple returns of all ccall types, JSRef and Any
wrapping is performed like for non-tuple returns
Any is to be wrapped by the callee, it's safe to unsafeCoerce to the actual type (including pre-wrapped JSRef)
This will probably lead to temporary breakage between ghcjs and ghcjs-base, but the current implementation is also buggy so it's better to make the change now, rather then when unboxed tuples are used more in the wild.
When returning an unboxed tuple in the javascript FFI, wrapping is expected from the JS code, even for JSRef. This is not done correctly everywhere, and is a source for confusion.
I'd like to change the convention to the following:
JSRef
andAny
Any
is to be wrapped by the callee, it's safe tounsafeCoerce
to the actual type (including pre-wrapped JSRef)This will probably lead to temporary breakage between ghcjs and ghcjs-base, but the current implementation is also buggy so it's better to make the change now, rather then when unboxed tuples are used more in the wild.