purescript-0.5.7.1: PureScript Programming Language Compiler

Safe HaskellSafe-Inferred

Language.PureScript.Pretty.Common

Description

Common pretty-printing utility functions

Synopsis

Documentation

parens :: String -> StringSource

Wrap a string in parentheses

newtype PrinterState Source

Constructors

PrinterState 

Fields

indent :: Int
 

Instances

blockIndent :: IntSource

Number of characters per identation level

withIndent :: StateT PrinterState Maybe String -> StateT PrinterState Maybe StringSource

Pretty print with a new indentation level

currentIndent :: StateT PrinterState Maybe StringSource

Get the current indentation level

prettyPrintMany :: (a -> StateT PrinterState Maybe String) -> [a] -> StateT PrinterState Maybe StringSource

Print many lines

prettyPrintObjectKey :: String -> StringSource

Prints an object key, escaping reserved names.