Skip to content

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

Open
@mgsloan

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions