hpython-0.3: Python language tools

Copyright(C) CSIRO 2017-2019
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

renderImportAs :: (e v a -> RenderOutput ()) -> ImportAs e v a -> RenderOutput () Source #

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