sifflet-2.3.0: Simple, visual, functional language for learning about recursion.

Safe HaskellNone
LanguageHaskell2010

Language.Sifflet.Export.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 String Source

Convert Sifflet name (of a function) to Python operator (Left) or function name (Right)

fixIdentifierChars :: String -> String Source

Remove characters that are not valid in a Python identifier, and in some cases, insert other characters to show what's missing

functionToPyDef :: Function -> PStatement Source

Create a Python def statement from a Sifflet function. Minimally parenthesized.