Module FlatCurry.Typed.Pretty

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

Summary of exported operations:

ppProg :: TProg -> Doc  Deterministic 
pretty-print a FlatCurry module
ppHeader :: String -> [TypeDecl] -> [TFuncDecl] -> Doc  Deterministic 
pretty-print the module header
ppExports :: [TypeDecl] -> [TFuncDecl] -> Doc  Deterministic 
pretty-print the export list
ppTypeExport :: TypeDecl -> Doc  Deterministic 
pretty-print a type export
ppConsExports :: [ConsDecl] -> [Doc]  Deterministic 
pretty-print the export list of constructors
ppFuncExports :: [TFuncDecl] -> [Doc]  Deterministic 
pretty-print the export list of functions
ppImports :: [String] -> Doc  Deterministic 
pretty-print a list of import statements
ppImport :: String -> Doc  Deterministic 
pretty-print a single import statement
ppOpDecls :: [OpDecl] -> Doc  Deterministic 
pretty-print a list of operator fixity declarations
ppOpDecl :: OpDecl -> Doc  Deterministic 
pretty-print a single operator fixity declaration
ppFixity :: Fixity -> Doc  Deterministic 
pretty-print the associativity keyword
ppTypeDecls :: [TypeDecl] -> Doc  Deterministic 
pretty-print a list of type declarations
ppTypeDecl :: TypeDecl -> Doc  Deterministic 
pretty-print a type declaration
ppConsDecls :: [ConsDecl] -> Doc  Deterministic 
pretty-print the constructor declarations
ppConsDecl :: ConsDecl -> Doc  Deterministic 
pretty print a single constructor
ppNewConsDecl :: NewConsDecl -> Doc  Deterministic 
pretty print a single newtype constructor
ppTypeExp :: TypeExpr -> Doc  Deterministic 
pretty a top-level type expression
ppTypeExpr :: Int -> TypeExpr -> Doc  Deterministic 
pretty-print a type expression
ppTVarIndex :: Int -> Doc  Deterministic 
pretty-print a type variable
ppFuncDecls :: [TFuncDecl] -> Doc  Deterministic 
pretty-print a list of function declarations
ppFuncDecl :: TFuncDecl -> Doc  Deterministic 
pretty-print a function declaration
ppRule :: TRule -> Doc  Deterministic 
pretty-print a function rule
ppExp :: TExpr -> Doc  Deterministic 
pretty-print a top-level expression
ppExpr :: Int -> TExpr -> Doc  Deterministic 
pretty-print an expression
ppTVarEIndex :: (Int,a) -> Doc  Deterministic 
pretty-print an annotated variable
ppVarEIndex :: Int -> Doc  Deterministic 
pretty-print a variable
ppLiteral :: Literal -> Doc  Deterministic 
pretty-print a literal
showEscape :: Char -> String  Deterministic 
Escape character literal
ppComb :: Int -> (String,String) -> [TExpr] -> Doc  Deterministic 
Pretty print a constructor or function call
ppDecls :: [((Int,a),TExpr)] -> Doc  Deterministic 
pretty-print a list of declarations
ppDecl :: ((Int,a),TExpr) -> Doc  Deterministic 
pretty-print a single declaration
ppCaseType :: CaseType -> Doc  Deterministic 
Pretty print the type of a case expression
ppBranch :: TBranchExpr -> Doc  Deterministic 
Pretty print a case branch
ppPattern :: TPattern -> Doc  Deterministic 
Pretty print a pattern
ppPrefixOp :: (String,String) -> Doc  Deterministic 
pretty-print a prefix operator
ppInfixOp :: (String,String) -> Doc  Deterministic 
pretty-print an infix operator
ppQName :: (String,String) -> Doc  Deterministic 
Pretty-print a qualified name
isInfixOp :: (String,String) -> Bool  Deterministic 
Check whether an operator is an infix operator
isListId :: (String,String) -> Bool  Deterministic 
Check whether an identifier represents a list
isTupleId :: (String,String) -> Bool  Deterministic 
Check whether an identifier represents a tuple
indent :: Doc -> Doc  Deterministic 
Indentation

Exported operations:

ppProg :: TProg -> Doc  Deterministic 

pretty-print a FlatCurry module

ppHeader :: String -> [TypeDecl] -> [TFuncDecl] -> Doc  Deterministic 

pretty-print the module header

ppExports :: [TypeDecl] -> [TFuncDecl] -> Doc  Deterministic 

pretty-print the export list

ppTypeExport :: TypeDecl -> Doc  Deterministic 

pretty-print a type export

ppConsExports :: [ConsDecl] -> [Doc]  Deterministic 

pretty-print the export list of constructors

ppFuncExports :: [TFuncDecl] -> [Doc]  Deterministic 

pretty-print the export list of functions

ppImports :: [String] -> Doc  Deterministic 

pretty-print a list of import statements

ppImport :: String -> Doc  Deterministic 

pretty-print a single import statement

ppOpDecls :: [OpDecl] -> Doc  Deterministic 

pretty-print a list of operator fixity declarations

ppOpDecl :: OpDecl -> Doc  Deterministic 

pretty-print a single operator fixity declaration

ppFixity :: Fixity -> Doc  Deterministic 

pretty-print the associativity keyword

Further infos:
  • solution complete, i.e., able to compute all solutions

ppTypeDecls :: [TypeDecl] -> Doc  Deterministic 

pretty-print a list of type declarations

ppTypeDecl :: TypeDecl -> Doc  Deterministic 

pretty-print a type declaration

ppConsDecls :: [ConsDecl] -> Doc  Deterministic 

pretty-print the constructor declarations

ppConsDecl :: ConsDecl -> Doc  Deterministic 

pretty print a single constructor

ppNewConsDecl :: NewConsDecl -> Doc  Deterministic 

pretty print a single newtype constructor

ppTypeExp :: TypeExpr -> Doc  Deterministic 

pretty a top-level type expression

ppTypeExpr :: Int -> TypeExpr -> Doc  Deterministic 

pretty-print a type expression

ppTVarIndex :: Int -> Doc  Deterministic 

pretty-print a type variable

ppFuncDecls :: [TFuncDecl] -> Doc  Deterministic 

pretty-print a list of function declarations

ppFuncDecl :: TFuncDecl -> Doc  Deterministic 

pretty-print a function declaration

ppRule :: TRule -> Doc  Deterministic 

pretty-print a function rule

ppExp :: TExpr -> Doc  Deterministic 

pretty-print a top-level expression

ppExpr :: Int -> TExpr -> Doc  Deterministic 

pretty-print an expression

ppTVarEIndex :: (Int,a) -> Doc  Deterministic 

pretty-print an annotated variable

ppVarEIndex :: Int -> Doc  Deterministic 

pretty-print a variable

ppLiteral :: Literal -> Doc  Deterministic 

pretty-print a literal

showEscape :: Char -> String  Deterministic 

Escape character literal

ppComb :: Int -> (String,String) -> [TExpr] -> Doc  Deterministic 

Pretty print a constructor or function call

ppDecls :: [((Int,a),TExpr)] -> Doc  Deterministic 

pretty-print a list of declarations

ppDecl :: ((Int,a),TExpr) -> Doc  Deterministic 

pretty-print a single declaration

ppCaseType :: CaseType -> Doc  Deterministic 

Pretty print the type of a case expression

Further infos:
  • solution complete, i.e., able to compute all solutions

ppBranch :: TBranchExpr -> Doc  Deterministic 

Pretty print a case branch

ppPattern :: TPattern -> Doc  Deterministic 

Pretty print a pattern

ppPrefixOp :: (String,String) -> Doc  Deterministic 

pretty-print a prefix operator

ppInfixOp :: (String,String) -> Doc  Deterministic 

pretty-print an infix operator

ppQName :: (String,String) -> Doc  Deterministic 

Pretty-print a qualified name

isInfixOp :: (String,String) -> Bool  Deterministic 

Check whether an operator is an infix operator

isListId :: (String,String) -> Bool  Deterministic 

Check whether an identifier represents a list

isTupleId :: (String,String) -> Bool  Deterministic 

Check whether an identifier represents a tuple

indent :: Doc -> Doc  Deterministic 

Indentation