git.iko.soy/distributed-process
on master help sign in
Cleanup
9d53fc4Edsko de Vries
distributed-process/distributed-process.cabal+1−1
@@ -51,13 +51,13 @@ Library
51 Control.Distributed.Process.Internal.Primitives,
51 Control.Distributed.Process.Internal.Primitives,
52 Control.Distributed.Process.Internal.CQueue,
52 Control.Distributed.Process.Internal.CQueue,
53 Control.Distributed.Process.Internal.Dynamic,
53 Control.Distributed.Process.Internal.Dynamic,
54− Control.Distributed.Process.Internal.Closure,
55 Control.Distributed.Process.Internal.TypeRep,
54 Control.Distributed.Process.Internal.TypeRep,
56 Control.Distributed.Process.Internal.MessageT,
55 Control.Distributed.Process.Internal.MessageT,
57 Control.Distributed.Process.Internal.Types,
56 Control.Distributed.Process.Internal.Types,
58 Control.Distributed.Process.Internal.Closure.BuiltIn,
57 Control.Distributed.Process.Internal.Closure.BuiltIn,
59 Control.Distributed.Process.Internal.Closure.Combinators,
58 Control.Distributed.Process.Internal.Closure.Combinators,
60 Control.Distributed.Process.Internal.Closure.TH,
59 Control.Distributed.Process.Internal.Closure.TH,
60+ Control.Distributed.Process.Internal.Closure.Resolution,
61 Control.Distributed.Process.Internal.Node
61 Control.Distributed.Process.Internal.Node
62 Extensions: RankNTypes,
62 Extensions: RankNTypes,
63 ScopedTypeVariables,
63 ScopedTypeVariables,
distributed-process/src/Control/Distributed/Process/Internal/Closure.hs → distributed-process/src/Control/Distributed/Process/Internal/Closure/Resolution.hsrenamed+1−23
@@ -1,8 +1,5 @@
1{-# LANGUAGE MagicHash #-}
1{-# LANGUAGE MagicHash #-}
2−module Control.Distributed.Process.Internal.Closure
2+module Control.Distributed.Process.Internal.Closure.Resolution (resolveClosure) where
3− ( -- * Runtime support
4− resolveClosure
5− ) where
6
3
7import Data.Accessor ((^.))
4import Data.Accessor ((^.))
8import Data.ByteString.Lazy (ByteString)
5import Data.ByteString.Lazy (ByteString)
@@ -29,23 +26,6 @@ import Control.Distributed.Process.Internal.Dynamic
29 )
26 )
30import Control.Distributed.Process.Internal.TypeRep () -- Binary instances
27import Control.Distributed.Process.Internal.TypeRep () -- Binary instances
31
28
32−{-
33−import qualified Control.Distributed.Process.Internal.Closure.BuiltIn as BuiltIn
34− (remoteTable)
35−import qualified Control.Distributed.Process.Internal.Closure.Combinators as Combinators
36− (remoteTable)
37−
38−-- | Initial (empty) remote-call meta data
39−initRemoteTable :: RemoteTable
40−initRemoteTable = BuiltIn.remoteTable
41− . Combinators.remoteTable
42− $ RemoteTable Map.empty Map.empty
43−-}
44−
45−--------------------------------------------------------------------------------
46−-- Runtime support for closures --
47−--------------------------------------------------------------------------------
48−
49resolveClosure :: RemoteTable -> StaticLabel -> ByteString -> Maybe Dynamic
29resolveClosure :: RemoteTable -> StaticLabel -> ByteString -> Maybe Dynamic
50-- Built-in closures
30-- Built-in closures
51resolveClosure rtable ClosureSend env = do
31resolveClosure rtable ClosureSend env = do
@@ -88,8 +68,6 @@ resolveClosure rtable CpApply env =
88resolveClosure rtable (UserStatic label) env = do
68resolveClosure rtable (UserStatic label) env = do
89 val <- rtable ^. remoteTableLabel label
69 val <- rtable ^. remoteTableLabel label
90 dynApply val (toDyn env)
70 dynApply val (toDyn env)
91−
92−-- User-defined polymorphic closures
93resolveClosure rtable (PolyStatic label) env = do
71resolveClosure rtable (PolyStatic label) env = do
94 Dynamic _ val <- rtable ^. remoteTableLabel label
72 Dynamic _ val <- rtable ^. remoteTableLabel label
95 return (Dynamic (decode env) val)
73 return (Dynamic (decode env) val)
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+1−1
@@ -118,7 +118,7 @@ import Control.Distributed.Process.Internal.MessageT
118 , getLocalNode
118 , getLocalNode
119 )
119 )
120import Control.Distributed.Process.Internal.Node (runLocalProcess)
120import Control.Distributed.Process.Internal.Node (runLocalProcess)
121−import Control.Distributed.Process.Internal.Closure (resolveClosure)
121+import Control.Distributed.Process.Internal.Closure.Resolution (resolveClosure)
122import Control.Distributed.Process.Internal.Dynamic (fromDyn, dynTypeRep)
122import Control.Distributed.Process.Internal.Dynamic (fromDyn, dynTypeRep)
123
123
124--------------------------------------------------------------------------------
124--------------------------------------------------------------------------------
distributed-process/src/Control/Distributed/Process/Node.hs+3−8
@@ -118,16 +118,11 @@ import Control.Distributed.Process.Internal.MessageT
118 , createMessage
118 , createMessage
119 )
119 )
120import Control.Distributed.Process.Internal.Dynamic (fromDynamic)
120import Control.Distributed.Process.Internal.Dynamic (fromDynamic)
121−import Control.Distributed.Process.Internal.Closure
121+import Control.Distributed.Process.Internal.Closure.Resolution (resolveClosure)
122− (
123− resolveClosure
124− )
125import Control.Distributed.Process.Internal.Node (runLocalProcess)
122import Control.Distributed.Process.Internal.Node (runLocalProcess)
126import Control.Distributed.Process.Internal.Primitives (expect, register)
123import Control.Distributed.Process.Internal.Primitives (expect, register)
127−import qualified Control.Distributed.Process.Internal.Closure.BuiltIn as BuiltIn
124+import qualified Control.Distributed.Process.Internal.Closure.BuiltIn as BuiltIn (remoteTable)
128− (remoteTable)
129−import qualified Control.Distributed.Process.Internal.Closure.Combinators as Combinators
125+import qualified Control.Distributed.Process.Internal.Closure.Combinators as Combinators (remoteTable)
130− (remoteTable)
131
126
132--------------------------------------------------------------------------------
127--------------------------------------------------------------------------------
133-- Initialization --
128-- Initialization --