| Safe Haskell | Safe-Infered | 
|---|
Sifflet.Foreign.ToPython
Description
Sifflet to abstract syntax tree for Python. Use Python module's pyPretty to pretty-print the result.
- data PythonOptions = PythonOptions
 - defaultPythonOptions :: PythonOptions
 - exprToPExpr :: Expr -> Expr
 - nameToPython :: String -> Either Operator String
 - fixIdentifierChars :: String -> String
 - functionToPyDef :: Function -> PStatement
 - defToPy :: FunctionDefTuple -> PStatement
 - functionsToPyModule :: Functions -> PModule
 - functionsToPrettyPy :: Functions -> String
 - exportPython :: PythonOptions -> Exporter
 
Documentation
data PythonOptions Source
Options for Python export. Should probably include choices like Python2 or Python3; if statement or if expression. Right now, just a placeholder.
Constructors
| PythonOptions | 
Instances
exprToPExpr :: Expr -> ExprSource
nameToPython :: String -> Either Operator StringSource
Convert Sifflet name (of a function) to Python operator (Left) or function name (Right)
fixIdentifierChars :: String -> StringSource
Remove characters that are not valid in a Python identifier, and in some cases, insert other characters to show what's missing
functionToPyDef :: Function -> PStatementSource
Create a Python def statement from a Sifflet function. Minimally parenthesized.