Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 6350808

Browse files
Merge pull request #12 from edsko/pr/RoleAnnotation
Role of static should be nominal
2 parents 957c257 + 87a0e67 commit 6350808

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Control/Distributed/Static.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
{-# LANGUAGE CPP #-}
171171
#if __GLASGOW_HASKELL__ >= 710
172172
{-# LANGUAGE StaticPointers #-}
173+
{-# LANGUAGE RoleAnnotations #-}
173174
#endif
174175
module Control.Distributed.Static
175176
( -- * Static values
@@ -289,6 +290,11 @@ instance NFData StaticLabel where
289290
newtype Static a = Static StaticLabel
290291
deriving (Eq, Ord, Typeable, Show)
291292

293+
-- Trying to 'coerce' static values will lead to unification errors
294+
#if __GLASGOW_HASKELL__ >= 710
295+
type role Static nominal
296+
#endif
297+
292298
instance NFData (Static a) where
293299
rnf (Static s) = rnf s
294300

@@ -493,7 +499,7 @@ decodeEnvPairStatic :: Static (ByteString -> (ByteString, ByteString))
493499
decodeEnvPairStatic = staticLabel "$decodeEnvPair"
494500

495501
-- | Closure application
496-
closureApply :: forall a b .
502+
closureApply :: forall a b .
497503
Closure (a -> b) -> Closure a -> Closure b
498504
closureApply (Closure fdec fenv) (Closure xdec xenv) =
499505
closure decoder (encode (fenv, xenv))

0 commit comments

Comments
 (0)