hpython-0.1: Syntax tree and DSL for Python

Copyright(C) CSIRO 2017-2018
LicenseBSD3
MaintainerIsaac Elliott <isaace71295@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Language.Python.Internal.Render

Contents

Description

 
Synopsis

Common Functions

showModule :: Module v a -> Text Source #

Render an entire Python module to Text

showStatement :: Statement v a -> Text Source #

Render a single Python statement to Text

showExpr :: Expr v a -> Text Source #

Render a single Python expression to Text

Rendering

data RenderOutput a Source #

A RenderOutput is an intermediate form used during rendering with efficient concatenation

showRenderOutput :: RenderOutput a -> Text Source #

Run a RenderOutput to produce a final Text.

These Texts should then not be appended any more. All appending should be done during the RenderOutput phase.

singleton :: PyToken () -> RenderOutput () Source #

Render a single token as a RenderOutput

Miscellany

renderArg :: (Expr v a -> RenderOutput ()) -> Arg v a -> RenderOutput () Source #