Copyright | (C) CSIRO 2017-2019 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- showModule :: Module v a -> Text
- showStatement :: Statement v a -> Text
- showExpr :: Expr v a -> Text
- data RenderOutput a
- showRenderOutput :: RenderOutput a -> Text
- singleton :: PyToken () -> RenderOutput ()
- renderModule :: Module v a -> RenderOutput ()
- renderStatement :: Statement v a -> RenderOutput ()
- renderExpr :: Expr v a -> RenderOutput ()
- showQuoteType :: QuoteType -> Char
- showStringPrefix :: StringPrefix -> Text
- showBytesPrefix :: BytesPrefix -> Text
- showToken :: PyToken a -> Text
- showTokens :: [PyToken a] -> Text
- expandIndents :: PyToken a -> [PyToken ()]
- whitespaceTokens :: Whitespace -> [PyToken ()]
- commentTokens :: Comment a -> [PyToken ()]
- parens :: RenderOutput a -> RenderOutput a
- braces :: RenderOutput a -> RenderOutput a
- brackets :: RenderOutput a -> RenderOutput a
- renderWhitespace :: Whitespace -> RenderOutput ()
- renderCommaSep :: (a -> RenderOutput ()) -> CommaSep a -> RenderOutput ()
- renderCommaSep1 :: (a -> RenderOutput ()) -> CommaSep1 a -> RenderOutput ()
- renderCommaSep1' :: (a -> RenderOutput ()) -> CommaSep1' a -> RenderOutput ()
- renderIdent :: Ident v a -> RenderOutput ()
- renderComment :: Comment a -> RenderOutput ()
- renderModuleName :: ModuleName v a -> RenderOutput ()
- renderDot :: Dot -> RenderOutput ()
- renderRelativeModuleName :: RelativeModuleName v a -> RenderOutput ()
- renderImportAs :: (e v a -> RenderOutput ()) -> ImportAs e v a -> RenderOutput ()
- renderImportTargets :: ImportTargets v a -> RenderOutput ()
- renderSimpleStatement :: SimpleStatement v a -> RenderOutput ()
- renderCompoundStatement :: CompoundStatement v a -> RenderOutput ()
- renderBlock :: Block v a -> RenderOutput ()
- renderIndent :: Indent -> RenderOutput ()
- renderIndents :: Indents a -> RenderOutput ()
- renderExceptAs :: ExceptAs v a -> RenderOutput ()
- renderArg :: (Expr v a -> RenderOutput ()) -> Arg v a -> RenderOutput ()
- renderParam :: Param v a -> RenderOutput ()
- renderParams :: CommaSep (Param v a) -> RenderOutput ()
- renderCompFor :: CompFor v a -> RenderOutput ()
- renderCompIf :: CompIf v a -> RenderOutput ()
- renderComprehension :: (e v a -> RenderOutput ()) -> Comprehension e v a -> RenderOutput ()
- renderBinOp :: BinOp a -> RenderOutput ()
- renderUnOp :: UnOp a -> RenderOutput ()
- renderSubscript :: Subscript v a -> RenderOutput ()
- renderPyChars :: QuoteType -> StringType -> [PyChar] -> Text
- escapeChars :: [(Char, Char)]
- intToHex :: Int -> Text
Common Functions
showModule :: Module v a -> Text #
Render an entire Python module to Text
showStatement :: Statement v a -> Text #
Render a single Python statement to Text
Rendering
data RenderOutput a #
A RenderOutput
is an intermediate form used during rendering
with efficient concatenation
Instances
Monad RenderOutput # | |
Defined in Language.Python.Internal.Render (>>=) :: RenderOutput a -> (a -> RenderOutput b) -> RenderOutput b # (>>) :: RenderOutput a -> RenderOutput b -> RenderOutput b # return :: a -> RenderOutput a # fail :: String -> RenderOutput a # | |
Functor RenderOutput # | |
Defined in Language.Python.Internal.Render fmap :: (a -> b) -> RenderOutput a -> RenderOutput b # (<$) :: a -> RenderOutput b -> RenderOutput a # | |
Applicative RenderOutput # | |
Defined in Language.Python.Internal.Render pure :: a -> RenderOutput a # (<*>) :: RenderOutput (a -> b) -> RenderOutput a -> RenderOutput b # liftA2 :: (a -> b -> c) -> RenderOutput a -> RenderOutput b -> RenderOutput c # (*>) :: RenderOutput a -> RenderOutput b -> RenderOutput b # (<*) :: RenderOutput a -> RenderOutput b -> RenderOutput a # |
showRenderOutput :: RenderOutput a -> Text #
Run a RenderOutput
to produce a final Text
.
These Text
s should then not be appended any more. All appending should
be done during the RenderOutput
phase.
singleton :: PyToken () -> RenderOutput () #
Render a single token as a RenderOutput
renderModule :: Module v a -> RenderOutput () #
renderStatement :: Statement v a -> RenderOutput () #
renderExpr :: Expr v a -> RenderOutput () #
Miscellany
showQuoteType :: QuoteType -> Char #
showStringPrefix :: StringPrefix -> Text #
showBytesPrefix :: BytesPrefix -> Text #
showTokens :: [PyToken a] -> Text #
expandIndents :: PyToken a -> [PyToken ()] #
whitespaceTokens :: Whitespace -> [PyToken ()] #
commentTokens :: Comment a -> [PyToken ()] #
parens :: RenderOutput a -> RenderOutput a #
braces :: RenderOutput a -> RenderOutput a #
brackets :: RenderOutput a -> RenderOutput a #
renderWhitespace :: Whitespace -> RenderOutput () #
renderCommaSep :: (a -> RenderOutput ()) -> CommaSep a -> RenderOutput () #
renderCommaSep1 :: (a -> RenderOutput ()) -> CommaSep1 a -> RenderOutput () #
renderCommaSep1' :: (a -> RenderOutput ()) -> CommaSep1' a -> RenderOutput () #
renderIdent :: Ident v a -> RenderOutput () #
renderComment :: Comment a -> RenderOutput () #
renderModuleName :: ModuleName v a -> RenderOutput () #
renderDot :: Dot -> RenderOutput () #
renderRelativeModuleName :: RelativeModuleName v a -> RenderOutput () #
renderImportAs :: (e v a -> RenderOutput ()) -> ImportAs e v a -> RenderOutput () #
renderImportTargets :: ImportTargets v a -> RenderOutput () #
renderSimpleStatement :: SimpleStatement v a -> RenderOutput () #
renderCompoundStatement :: CompoundStatement v a -> RenderOutput () #
renderBlock :: Block v a -> RenderOutput () #
renderIndent :: Indent -> RenderOutput () #
renderIndents :: Indents a -> RenderOutput () #
renderExceptAs :: ExceptAs v a -> RenderOutput () #
renderArg :: (Expr v a -> RenderOutput ()) -> Arg v a -> RenderOutput () #
renderParam :: Param v a -> RenderOutput () #
renderParams :: CommaSep (Param v a) -> RenderOutput () #
renderCompFor :: CompFor v a -> RenderOutput () #
renderCompIf :: CompIf v a -> RenderOutput () #
renderComprehension :: (e v a -> RenderOutput ()) -> Comprehension e v a -> RenderOutput () #
renderBinOp :: BinOp a -> RenderOutput () #
renderUnOp :: UnOp a -> RenderOutput () #
renderSubscript :: Subscript v a -> RenderOutput () #
renderPyChars :: QuoteType -> StringType -> [PyChar] -> Text #
escapeChars :: [(Char, Char)] #