Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a variant of JSRef which lacks a type parameter? #6

Open
mgsloan opened this issue May 20, 2015 · 0 comments
Open

Have a variant of JSRef which lacks a type parameter? #6

mgsloan opened this issue May 20, 2015 · 0 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented May 20, 2015

The idea is to have something like this:

#ifdef ghcjs_HOST_OS
data JSRef' = JSRef' ByteArray#
#else
data JSRef' = JSRef' Addr#
#endif

newtype JSRef a = JSRef JSRef'

Why is this better? Because you can't use Coercible a (JSRef b) when b is ambiguous. It occurs to me that this constraint ought to work due to the type parameter of JSRef being phantom, but perhaps this is an issue with the implementation of Coercible (on GHC 7.8, anyway).

Anyway, even if this is a GHC bug, it seems cleaner to have this separation.

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

No branches or pull requests

1 participant