@@ -8,6 +8,7 @@ module Control.Distributed.Process.Internal.Closure.TH
8 , functionSDict
8 , functionSDict
9 , functionTDict
9 , functionTDict
10 , mkClosure
10 , mkClosure
13import Prelude hiding (succ, any)
14import Prelude hiding (succ, any)
@@ -58,6 +59,7 @@ import Control.Distributed.Static
58 , staticLabel
59 , staticLabel
60 , staticCompose
61 , staticCompose
62import Control.Distributed.Process.Internal.Types (Process)
64import Control.Distributed.Process.Internal.Types (Process)
63import Control.Distributed.Process.Serializable
65import Control.Distributed.Process.Serializable
@@ -146,6 +148,13 @@ mkClosure n =
151+-- | Make a 'Closure' from a static function. This is useful for
152+-- making a closure for a top-level @Process ()@ function, because
153+-- using 'mkClosure' would require adding a dummy @()@ argument.
155+mkStaticClosure :: Name -> Q Exp
156+mkStaticClosure n = [| staticClosure $( mkStatic n ) |]
149--------------------------------------------------------------------------------
158--------------------------------------------------------------------------------
150-- Internal (Template Haskell) --
159-- Internal (Template Haskell) --
151--------------------------------------------------------------------------------
160--------------------------------------------------------------------------------