git.iko.soy/distributed-process
on master help sign in
Rename remotableDec to remotableDecl
54fcbbdEdsko de Vries
distributed-process/src/Control/Distributed/Process/Closure.hs+2−2
@@ -179,7 +179,7 @@ module Control.Distributed.Process.Closure
179#ifdef TemplateHaskellSupport
179#ifdef TemplateHaskellSupport
180 -- * Template Haskell support for creating static values and closures
180 -- * Template Haskell support for creating static values and closures
181 , remotable
181 , remotable
182− , remotableDec
182+ , remotableDecl
183 , mkStatic
183 , mkStatic
184 , mkClosure
184 , mkClosure
185 , functionSDict
185 , functionSDict
@@ -211,7 +211,7 @@ import Control.Distributed.Process.Internal.Closure.BuiltIn
211#ifdef TemplateHaskellSupport
211#ifdef TemplateHaskellSupport
212import Control.Distributed.Process.Internal.Closure.TH
212import Control.Distributed.Process.Internal.Closure.TH
213 ( remotable
213 ( remotable
214− , remotableDec
214+ , remotableDecl
215 , mkStatic
215 , mkStatic
216 , functionSDict
216 , functionSDict
217 , functionTDict
217 , functionTDict
distributed-process/src/Control/Distributed/Process/Internal/Closure/TH.hs+10−10
@@ -3,7 +3,7 @@
3module Control.Distributed.Process.Internal.Closure.TH
3module Control.Distributed.Process.Internal.Closure.TH
4 ( -- * User-level API
4 ( -- * User-level API
5 remotable
5 remotable
6− , remotableDec
6+ , remotableDecl
7 , mkStatic
7 , mkStatic
8 , functionSDict
8 , functionSDict
9 , functionTDict
9 , functionTDict
@@ -84,28 +84,28 @@ remotable ns = do
84-- >
84-- >
85-- > remotable ['f]
85-- > remotable ['f]
86--
86--
87−-- with 'remotableDec' you would instead do
87+-- with 'remotableDecl' you would instead do
88--
88--
89−-- > remotableDec [
89+-- > remotableDecl [
90-- > [d| f :: T1 -> T2 ;
90-- > [d| f :: T1 -> T2 ;
91-- > f = ...
91-- > f = ...
92-- > |]
92-- > |]
93-- > ]
93-- > ]
94--
94--
95−-- 'remotableDec' creates the function specified as well as the various
95+-- 'remotableDecl' creates the function specified as well as the various
96-- dictionaries and static versions that 'remotable' also creates.
96-- dictionaries and static versions that 'remotable' also creates.
97−-- 'remotableDec' is sometimes necessary when you want to refer to, say,
97+-- 'remotableDecl' is sometimes necessary when you want to refer to, say,
98-- @$(mkClosure 'f)@ within the definition of @f@ itself.
98-- @$(mkClosure 'f)@ within the definition of @f@ itself.
99--
99--
100−-- NOTE: 'remotableDec' creates @__remoteTableDec@ instead of @__remoteTable@
100+-- NOTE: 'remotableDecl' creates @__remoteTableDecl@ instead of @__remoteTable@
101−-- so that you can use both 'remotable' and 'remotableDec' within the same
101+-- so that you can use both 'remotable' and 'remotableDecl' within the same
102-- module.
102-- module.
103−remotableDec :: [Q [Dec]] -> Q [Dec]
103+remotableDecl :: [Q [Dec]] -> Q [Dec]
104−remotableDec qDecs = do
104+remotableDecl qDecs = do
105 decs <- concat <$> sequence qDecs
105 decs <- concat <$> sequence qDecs
106 let types = catMaybes (map typeOf decs)
106 let types = catMaybes (map typeOf decs)
107 (closures, inserts) <- unzip <$> mapM generateDefs types
107 (closures, inserts) <- unzip <$> mapM generateDefs types
108− rtable <- createMetaData (mkName "__remoteTableDec") (concat inserts)
108+ rtable <- createMetaData (mkName "__remoteTableDecl") (concat inserts)
109 return $ decs ++ concat closures ++ rtable
109 return $ decs ++ concat closures ++ rtable
110 where
110 where
111 typeOf :: Dec -> Maybe (Name, Type)
111 typeOf :: Dec -> Maybe (Name, Type)
distributed-process/tests/TestClosure.hs+2−2
@@ -88,7 +88,7 @@ randomElement xs = do
88 ix <- randomIO
88 ix <- randomIO
89 return (xs !! (ix `mod` length xs))
89 return (xs !! (ix `mod` length xs))
90
90
91−remotableDec [
91+remotableDecl [
92 [d| dfib :: ([NodeId], SendPort Integer, Integer) -> Process () ;
92 [d| dfib :: ([NodeId], SendPort Integer, Integer) -> Process () ;
93 dfib (_, reply, 0) = sendChan reply 0
93 dfib (_, reply, 0) = sendChan reply 0
94 dfib (_, reply, 1) = sendChan reply 1
94 dfib (_, reply, 1) = sendChan reply 1
@@ -427,7 +427,7 @@ testSpawnReconnect transport rtable transportInternals = do
427main :: IO ()
427main :: IO ()
428main = do
428main = do
429 Right (transport, transportInternals) <- createTransportExposeInternals "127.0.0.1" "8080" defaultTCPParameters
429 Right (transport, transportInternals) <- createTransportExposeInternals "127.0.0.1" "8080" defaultTCPParameters
430− let rtable = __remoteTable . __remoteTableDec $ initRemoteTable
430+ let rtable = __remoteTable . __remoteTableDecl $ initRemoteTable
431 runTests
431 runTests
432 [ ("Unclosure", testUnclosure transport rtable)
432 [ ("Unclosure", testUnclosure transport rtable)
433 , ("Bind", testBind transport rtable)
433 , ("Bind", testBind transport rtable)