Open
Description
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.
Metadata
Assignees
Labels
No labels