Module ICurry.Pretty

Author
Marc Andre Wittorf and Michael Hanus
Version
November 2020

This module contains a pretty printer for ICurry programs.

Exported Functions


ppIProg :: IProg -> Doc  Deterministic 

Pretty print an ICurry module

:: IProg  the module
-> Doc  the pretty printed module

ppHeader :: String -> Doc  Deterministic 

Pretty print an ICurry module header

:: String  the module name
-> Doc  the pretty printed module header

ppImports :: [String] -> Doc  Deterministic 

Pretty print an ICurry module import list

:: [String]  the imported modules' names
-> Doc  the pretty printed import list

ppImport :: String -> Doc  Deterministic 

Pretty print an import directive

:: String  the imported module's name
-> Doc  the pretty printed module import directive

ppDataTypes :: [IDataType] -> Doc  Deterministic 

Pretty print ICurry types

:: [IDataType]  the data type declarations
-> Doc  the pretty printed types

ppDataType :: IDataType -> Doc  Deterministic 

Pretty print an ICurry type

:: IDataType  the data type declaration
-> Doc  the pretty printed type

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

Pretty print ICurry constructors

:: [(IQName, IArity)]  the data constructors
-> Doc  the pretty printed constructors

ppConstructor :: ((String, String, Int), Int) -> Doc  Deterministic 

Pretty print an ICurry constructor

:: (IQName, IArity)  the data constructor
-> Doc  the pretty printed constructor

ppFunctions :: [IFunction] -> Doc  Deterministic 

Pretty print ICurry functions

:: [IFunction]  the functions
-> Doc  the pretty printed functions

ppFunction :: IFunction -> Doc  Deterministic 

Pretty print an ICurry function

:: IFunction  the function
-> Doc  the pretty printed function

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

Pretty print a qualified ICurry name (module.localname)

:: IQName  the name
-> Doc  the pretty printed name

ppFuncBody :: IFuncBody -> Doc  Deterministic 

Pretty print an ICurry function's body

:: IFuncBody  the function's body
-> Doc  the pretty printed function body

ppVars :: [Int] -> Doc  Deterministic 

Pretty print a list of variables

:: [IVarIndex]  the variables
-> Doc  the pretty printed variables

ppVar :: Int -> Doc  Deterministic 

Pretty print a variable. Variables are called x0, x1, ... Since variable with index 0 is always used for the root, we print it as ROOT.

:: IVarIndex  the variable
-> Doc  the pretty printed variable
Further infos:
  • partially defined

ppBlock :: IBlock -> Doc  Deterministic 

Pretty print an ICurry block

:: IBlock  the block
-> Doc  the rendered block

ppStatement :: IStatement -> Doc  Deterministic 

Pretty print an ICurry block

:: IStatement  the block
-> Doc  the rendered block

ppVarDecls :: [IVarDecl] -> Doc  Deterministic 

Pretty print local variable declarations

:: [IVarDecl]  the local variables
-> Doc  the pretty printed variable declarations

ppVarDecl :: IVarDecl -> Doc  Deterministic 

Pretty print a local variable declaration.


ppAssignments :: [IAssign] -> Doc  Deterministic 

Pretty print assignments

:: [IAssign]  the assignments
-> Doc  the pretty printed assignments

ppAssignment :: IAssign -> Doc  Deterministic 

Pretty print an assignment

:: IAssign  the assignment
-> Doc  the pretty printed assignment

ppExprs :: [IExpr] -> Doc  Deterministic 

Pretty print comma separated expressions

:: [IExpr]  the expressions
-> Doc  the pretty printed expressions

ppExpr :: IExpr -> Doc  Deterministic 

Pretty print an ICurry expression

:: IExpr  the expression
-> Doc  the pretty printed expression

ppConsBranches :: [IConsBranch] -> Doc  Deterministic 

Pretty print branches over constructors

:: [IConsBranch]  the branches
-> Doc  the pretty printed branches

ppConsBranch :: IConsBranch -> Doc  Deterministic 

Pretty print a branch over constructors

:: IConsBranch  the branch
-> Doc  the pretty printed branch

ppLitBranches :: [ILitBranch] -> Doc  Deterministic 

Pretty print branches over literals

:: [ILitBranch]  the branches
-> Doc  the pretty printed branches

ppLitBranch :: ILitBranch -> Doc  Deterministic 

Pretty print a branch over literals

:: ILitBranch  the branch
-> Doc  the pretty printed branch

ppPos :: [Int] -> Doc  Deterministic 

Pretty print an ICurry position


ppLit :: ILiteral -> Doc  Deterministic 

Pretty print an ICurry literal

:: ILiteral  the literal
-> Doc  the pretty printed literal