diff --git a/src/Foreign/Object.purs b/src/Foreign/Object.purs index 364d7db..e295df7 100644 --- a/src/Foreign/Object.purs +++ b/src/Foreign/Object.purs @@ -64,6 +64,8 @@ import Unsafe.Coerce (unsafeCoerce) -- | `Object a` represents a homogeneous JS Object with values of type `a`. foreign import data Object :: Type -> Type +type role Object representational + foreign import _copyST :: forall a b r. a -> ST r b -- | Convert an immutable Object into a mutable Object diff --git a/src/Foreign/Object/ST.purs b/src/Foreign/Object/ST.purs index 19a6638..7fad439 100644 --- a/src/Foreign/Object/ST.purs +++ b/src/Foreign/Object/ST.purs @@ -24,6 +24,8 @@ import Data.Maybe (Maybe(..)) -- | that of `Object a`, except that mutation is allowed. foreign import data STObject :: Region -> Type -> Type +type role STObject nominal representational + -- | Create a new, empty mutable object foreign import new :: forall a r. ST r (STObject r a)