Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Pretty-printing JavaScript
Synopsis
- renderJs :: (JsToDoc a, JMacro a) => a -> Doc
- renderJs' :: (JsToDoc a, JMacro a) => RenderJs -> a -> Doc
- renderPrefixJs :: (JsToDoc a, JMacro a) => FastString -> a -> Doc
- renderPrefixJs' :: (JsToDoc a, JMacro a) => RenderJs -> FastString -> a -> Doc
- class JsToDoc a where
- defaultRenderJs :: RenderJs
- data RenderJs = RenderJs {}
- jsToDoc :: JsToDoc a => a -> Doc
- pprStringLit :: FastString -> Doc
- flattenBlocks :: [JStat] -> [JStat]
- braceNest :: Doc -> Doc
- hangBrace :: Doc -> Doc -> Doc
Documentation
renderJs :: (JsToDoc a, JMacro a) => a -> Doc Source #
Render a syntax tree as a pretty-printable document (simply showing the resultant doc produces a nice, well formatted String).
renderPrefixJs :: (JsToDoc a, JMacro a) => FastString -> a -> Doc Source #
Render a syntax tree as a pretty-printable document, using a given prefix to all generated names. Use this with distinct prefixes to ensure distinct generated names between independent calls to render(Prefix)Js.
renderPrefixJs' :: (JsToDoc a, JMacro a) => RenderJs -> FastString -> a -> Doc Source #
pprStringLit :: FastString -> Doc Source #
flattenBlocks :: [JStat] -> [JStat] Source #