sifflet-lib-1.2.5: Library of modules shared by sifflet and its tests and its exporters.

Safe HaskellSafe-Infered

Sifflet.Foreign.ToPython

Description

Sifflet to abstract syntax tree for Python. Use Python module's pyPretty to pretty-print the result.

Synopsis

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 

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.