This library provides pretty-printers for TypedFlatCurry modules and all substructures (e.g., expressions). Note that types are ignored for pretty-printing. The mocule is based on the pretty-printer for AnnotatedFlatCurry by Bjoern Peemoeller from October 2015
Author: Kai-Oliver Prott
Version: June 2018
ppProg
:: TProg -> Doc
pretty-print a FlatCurry module |
ppHeader
:: String -> [TypeDecl] -> [TFuncDecl] -> Doc
pretty-print the module header |
ppExports
:: [TypeDecl] -> [TFuncDecl] -> 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
:: [TFuncDecl] -> [Doc]
pretty-print the export list of functions |
ppImports
:: [String] -> Doc
pretty-print a list of import statements |
ppImport
:: String -> Doc
pretty-print a single import statement |
ppOpDecls
:: [OpDecl] -> Doc
pretty-print a list of operator fixity declarations |
ppOpDecl
:: OpDecl -> Doc
pretty-print a single operator fixity declaration |
ppFixity
:: Fixity -> Doc
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 |
ppTypeExp
:: TypeExpr -> Doc
pretty a top-level type expression |
ppTypeExpr
:: Int -> TypeExpr -> Doc
pretty-print a type expression |
ppTVarIndex
:: Int -> Doc
pretty-print a type variable |
ppFuncDecls
:: [TFuncDecl] -> Doc
pretty-print a list of function declarations |
ppFuncDecl
:: TFuncDecl -> Doc
pretty-print a function declaration |
ppRule
:: TRule -> Doc
pretty-print a function rule |
ppExp
:: TExpr -> Doc
pretty-print a top-level expression |
ppExpr
:: Int -> TExpr -> Doc
pretty-print an expression |
ppTVarEIndex
:: (Int,a) -> Doc
pretty-print an annotated variable |
ppVarEIndex
:: Int -> Doc
pretty-print a variable |
ppLiteral
:: Literal -> Doc
pretty-print a literal |
showEscape
:: Char -> String
Escape character literal |
ppComb
:: Int -> (String,String) -> [TExpr] -> Doc
Pretty print a constructor or function call |
ppDecls
:: [((Int,a),TExpr)] -> Doc
pretty-print a list of declarations |
ppDecl
:: ((Int,a),TExpr) -> Doc
pretty-print a single declaration |
ppCaseType
:: CaseType -> Doc
Pretty print the type of a case expression |
ppBranch
:: TBranchExpr -> Doc
Pretty print a case branch |
ppPattern
:: TPattern -> 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 |
indent
:: Doc -> Doc
Indentation |
pretty-print a type export |
pretty-print the export list of constructors |
pretty-print the export list of functions |
pretty-print the associativity keyword
|
pretty-print a list of type declarations |
pretty-print a type declaration |
pretty-print the constructor declarations |
pretty print a single constructor |
pretty print a single newtype constructor |
pretty-print a type expression |
pretty-print a type variable |
pretty-print a list of function declarations |
pretty-print a function declaration |
pretty-print an annotated variable |
pretty-print a variable |
Escape character literal |
Pretty print the type of a case expression
|
Pretty print a case branch |
pretty-print a prefix operator |
Check whether an operator is an infix operator |
Check whether an identifier represents a list |
Check whether an identifier represents a tuple |