@@ -20,21 +20,24 @@
21-- > unClosure :: Typeable a => Closure a -> Process a
21-- > unClosure :: Typeable a => Closure a -> Process a
23+-- In general, given a monomorphic function @f : a -> b@ the corresponding
24+-- function @$(mkClosure 'f)@ will have type @a -> Closure b@.
23-- The call to 'remotable' will also generate a function
26-- The call to 'remotable' will also generate a function
25-- > __remoteCallMetaData :: RemoteCallMetaData -> RemoteCallMetaData
28-- > __remoteCallMetaData :: RemoteCallMetaData -> RemoteCallMetaData
27-- which can be used to construct the 'RemoteCallMetaData' used to initialize
30-- which can be used to construct the 'RemoteCallMetaData' used to initialize
28−-- Cloud Haskell. You should have one call to 'remotable' per module, and
31+-- Cloud Haskell. You should have (at most) one call to 'remotable' per module,
29−-- compose all created functions when initializing Cloud Haskell:
32+-- and compose all created functions when initializing Cloud Haskell:
31-- > let metaData = M1.__remoteCallMetaData
34-- > let metaData = M1.__remoteCallMetaData
32-- > . M2.__remoteCallMetaData
35-- > . M2.__remoteCallMetaData
34-- > . Mn.__remoteCallMetaData
37-- > . Mn.__remoteCallMetaData
35−-- > $ Map.empty
38+-- > $ initRemoteCallMetaData
37−-- See Section 6, Faking It, of Towards Haskell in the Cloud for more info.
40+-- See Section 6, /Faking It/, of /Towards Haskell in the Cloud/ for more info.
38{-# LANGUAGE TemplateHaskell #-}
41{-# LANGUAGE TemplateHaskell #-}
39module Control.Distributed.Process.Closure
42module Control.Distributed.Process.Closure
40 ( unClosure
43 ( unClosure
@@ -53,7 +56,6 @@ import Control.Monad.Reader (ask)
53import Control.Exception (throw)
56import Control.Exception (throw)
54import Language.Haskell.TH ( -- Q monad and operations
57import Language.Haskell.TH ( -- Q monad and operations
@@ -102,7 +104,6 @@ remotable :: [Name] -> Q [Dec]
102remotable ns = do
104remotable ns = do
103 (closures, decoders, inserts) <- unzip3 <$> mapM process ns
105 (closures, decoders, inserts) <- unzip3 <$> mapM process ns
104 metaData <- createMetaData inserts
106 metaData <- createMetaData inserts
105− report False "Cloud Haskell '__remoteCallMetaData' generated"
106 return $ concat closures ++ concat decoders ++ metaData
107 return $ concat closures ++ concat decoders ++ metaData
108-- | Deserialize a closure
109-- | Deserialize a closure