This library provides pretty-printers for AnnotatedFlatCurry modules and all substructures (e.g., expressions). Note that annotations are ignored for pretty-printing.
pretty-print a FlatCurry module
ppHeader
:: String -> [TypeDecl] -> [AFuncDecl a] -> Doc
pretty-print the module header
ppExports
:: [TypeDecl] -> [AFuncDecl a] -> Doc
pretty-print the export list
ppTypeExport
:: TypeDecl -> Doc
pretty-print a type export
ppConsExports
:: [ConsDecl] -> [Doc]
pretty-print the export list of constructors
ppFuncExports
:: [AFuncDecl a] -> [Doc]
pretty-print the export list of functions
pretty-print a list of import statements
pretty-print a single import statement
pretty-print a list of operator fixity declarations
pretty-print a single operator fixity declaration
pretty-print the associativity keyword
ppTypeDecls
:: [TypeDecl] -> Doc
pretty-print a list of type declarations
ppTypeDecl
:: TypeDecl -> Doc
pretty-print a type declaration
ppConsDecls
:: [ConsDecl] -> Doc
pretty-print the constructor declarations
ppConsDecl
:: ConsDecl -> Doc
pretty print a single constructor
ppNewConsDecl
:: NewConsDecl -> Doc
pretty print a single newtype constructor
pretty a top-level type expression
ppTypeExpr
:: Int -> TypeExpr -> Doc
pretty-print a type expression
ppQuantifiedVars
:: [(Int, Kind)] -> Doc
pretty-print explicitly quantified type variables
ppTVarIndex
:: Int -> Doc
pretty-print a type variable
ppFuncDecls
:: [AFuncDecl a] -> Doc
pretty-print a list of function declarations
ppFuncDecl
:: AFuncDecl a -> Doc
pretty-print a function declaration
pretty-print a function rule
pretty-print a top-level expression
ppExpr
:: Int -> AExpr a -> Doc
pretty-print an expression
ppAVarIndex
:: (Int, a) -> Doc
pretty-print an annotated variable
ppVarIndex
:: Int -> Doc
pretty-print a variable
pretty-print a literal
showEscape
:: Char -> String
Escape character literal
ppComb
:: Int -> ((String, String), a) -> [AExpr b] -> Doc
Pretty print a constructor or function call
ppDecls
:: [((Int, a), AExpr b)] -> Doc
pretty-print a list of declarations
ppDecl
:: ((Int, a), AExpr b) -> Doc
pretty-print a single declaration
ppCaseType
:: CaseType -> Doc
Pretty print the type of a case expression
ppBranch
:: ABranchExpr a -> Doc
Pretty print a case branch
ppPattern
:: APattern a -> Doc
Pretty print a pattern
ppPrefixOp
:: (String, String) -> Doc
pretty-print a prefix operator
ppInfixOp
:: (String, String) -> Doc
pretty-print an infix operator
ppQName
:: (String, String) -> Doc
Pretty-print a qualified name
isInfixOp
:: (String, String) -> Bool
Check whether an operator is an infix operator
isListId
:: (String, String) -> Bool
Check whether an identifier represents a list
isTupleId
:: (String, String) -> Bool
Check whether an identifier represents a tuple
Indentation