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

Role of static should be nominal #12

Merged
merged 1 commit into from
Oct 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Control/Distributed/Static.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 710
{-# LANGUAGE StaticPointers #-}
{-# LANGUAGE RoleAnnotations #-}
#endif
module Control.Distributed.Static
( -- * Static values
Expand Down Expand Up @@ -289,6 +290,11 @@ instance NFData StaticLabel where
newtype Static a = Static StaticLabel
deriving (Eq, Ord, Typeable, Show)

-- Trying to 'coerce' static values will lead to unification errors
#if __GLASGOW_HASKELL__ >= 710
type role Static nominal
#endif

instance NFData (Static a) where
rnf (Static s) = rnf s

Expand Down Expand Up @@ -493,7 +499,7 @@ decodeEnvPairStatic :: Static (ByteString -> (ByteString, ByteString))
decodeEnvPairStatic = staticLabel "$decodeEnvPair"

-- | Closure application
closureApply :: forall a b .
closureApply :: forall a b .
Closure (a -> b) -> Closure a -> Closure b
closureApply (Closure fdec fenv) (Closure xdec xenv) =
closure decoder (encode (fenv, xenv))
Expand Down