@@ -1,5 +1,6 @@
1-- | We collect all types used internally in a single module to avoid using
1-- | We collect all types used internally in a single module to avoid using
2-- mutually recursive modules
2-- mutually recursive modules
3+{-# LANGUAGE MagicHash #-}
3module Control.Distributed.Process.Internal.Types
4module Control.Distributed.Process.Internal.Types
4 ( -- * Node and process identifiers
5 ( -- * Node and process identifiers
@@ -98,13 +99,15 @@ import Control.Distributed.Process.Serializable
99import Control.Distributed.Process.Internal.CQueue (CQueue)
100import Control.Distributed.Process.Internal.CQueue (CQueue)
100import Control.Distributed.Process.Internal.Dynamic
101import Control.Distributed.Process.Internal.Dynamic
101− ( Dynamic
102+ ( Dynamic(..)
103 , dynTypeRep
104 , dynTypeRep
105 , dynBind
106 , dynBind
106 , dynApply
107 , dynApply
110+import Control.Distributed.Process.Internal.TypeRep ()
109--------------------------------------------------------------------------------
112--------------------------------------------------------------------------------
110-- Node and process identifiers --
113-- Node and process identifiers --
@@ -259,13 +262,16 @@ resolveClosure rtable "$call" env = do
260 (label, env', pid) = decode env
263 (label, env', pid) = decode env
261 bind = dynBind tyConProcess bindProcess
264 bind = dynBind tyConProcess bindProcess
262−resolveClosure rtable "$bind" env = do
265+resolveClosure rtable "$applyClosure" env = do
266+ f <- resolveClosure rtable labelf envf
263− x <- resolveClosure rtable xlabel envx
267+ x <- resolveClosure rtable labelx envx
264− f <- resolveClosure rtable flabel envf
268+ f `dynApply` x
267− ((xlabel, envx), (flabel, envf)) = decode env
270+ (labelf, envf, labelx, envx) = decode env
268− bind = dynBind tyConProcess bindProcess
271+resolveClosure _rtable "$liftedBind" env =
272+ return $ Dynamic typ (unsafeCoerce# bindProcess)
269resolveClosure rtable label env = do
275resolveClosure rtable label env = do
270 val <- rtable ^. remoteTableLabel label
276 val <- rtable ^. remoteTableLabel label
271 dynApply val (toDyn env)
277 dynApply val (toDyn env)