This library contains operations to transform FlatCurry programs into string representations, either in a FlatCurry format or in a Curry-like syntax.
This library contains
showFlatProg
, showFlatType
, showFlatFunc
)
showCurryType
, showCurryExpr
,...).
showFlatProg
:: Prog -> String
Shows a FlatCurry program term as a string (with some pretty printing).
showFlatType
:: TypeDecl -> String
showFlatFunc
:: FuncDecl -> String
showCurryType
:: ((String, String) -> String) -> Bool -> TypeExpr -> String
Shows a FlatCurry type in Curry syntax.
:: QName -> String
|
a translation function from qualified type names to external type names |
-> Bool
|
True iff brackets must be written around complex types |
-> TypeExpr
|
the FlatCurry type expression to be formatted |
-> String
|
the String representation of the formatted type expression |
isClassContext
:: TypeExpr -> Maybe (String, [TypeExpr])
Tests whether a FlatCurry type is a class context. If it is the case, return the class name and the type parameters of the class context.
showCurryExpr
:: ((String, String) -> String) -> Bool -> Int -> Expr -> String
Shows a FlatCurry expressions in (almost) Curry syntax.
:: QName -> String
|
a translation function from qualified functions names to external function names |
-> Bool
|
True iff brackets must be written around complex terms |
-> Int
|
the indentation used in case expressions and if-then-else |
-> Expr
|
the FlatCurry expression to be formatted |
-> String
|
the String representation of the formatted expression |
showCurryVar
:: Show a => a -> String
showCurryId
:: String -> String
Shows an identifier in Curry form. Thus, operators are enclosed in brackets.