Safe Haskell | None |
---|
Combines the construction of RPC server components and their Python stubs.
Synopsis
- pythonIndentStep :: Int
- nest' :: Doc -> Doc
- genericInvokeName :: String
- socketPathName :: String
- apply :: String -> [Doc] -> Doc
- emptyLine :: Doc
- lowerFirst :: String -> String
- upperFirst :: String -> String
- toFunc :: String -> [Type] -> Q Doc
- nameToFunc :: Name -> Q Doc
- namesToClass :: String -> Doc -> [Name] -> Q Doc
- genPyUDSRpcStub :: String -> String -> [Name] -> Q Doc
- genPyUDSRpcStubStr :: String -> String -> [Name] -> Q Exp
Documentation
pythonIndentStep :: Int Source #
The indentation step in generated Python files.
A helper function that nests a block of generated output by the default
step (see pythonIndentStep
).
genericInvokeName :: String Source #
The name of an abstract function to which all method in a Python stub are forwarded to.
socketPathName :: String Source #
The name of a function that returns the socket path for reaching the appropriate RPC client.
apply :: String -> [Doc] -> Doc Source #
Create a Python expression that applies a given function to a list of given expressions
lowerFirst :: String -> String Source #
upperFirst :: String -> String Source #
toFunc :: String -> [Type] -> Q Doc Source #
Creates a method declaration given a function name and a list of Haskell types corresponding to its arguments.
nameToFunc :: Name -> Q Doc Source #
Creates a method declaration by inspecting (reifying) Haskell's function name.
:: String | the class name |
-> Doc | Python code to include in the class |
-> [Name] | the list of functions to include |
-> Q Doc |
Generates a Python class stub, given a class name, the list of Haskell functions to expose as methods, and a optionally a piece of code to include.
:: String | the name of the class to be generated |
-> String | the name of the constant from |
-> [Name] | names of functions to include |
-> Q Doc |
Takes a list of function names and creates a RPC handler that delegates calls to them, as well as writes out the corresponding Python stub.
See mkRpcM
for the requirements on the passed functions and the returned
expression.
:: String | the name of the class to be generated |
-> String | the constant in |
-> [Name] | functions to include |
-> Q Exp |