A collection of useful string filters.
The possible fixities of operators.
The binary operator occurs in infix position (i.e., between its two operands).
A pretty-printer with support for pretty-printing expressions with minimal parenthesisation.
A pretty-printer with support for pretty-printing expressions with minimal parenthesisation.
Based on algorithm in "Unparsing expressions with prefix and postfix operators", Ramsey, SP&E, 28 (12), October 1998. We have not implemented support for arbitrary arity infix operators.
Binary expressions that are to be pretty-printed.
Binary expressions that are to be pretty-printed. left
and right
give the two operand expressions and op
the string that is to be
used as the output of the operator.
Super type of all expressions that are to be pretty-printed.
N-ary infix expressions that are to be pretty-printed.
An expression that contains an operator.
An expression that contains an operator. Defines priority
to relate
the operator to other operators (lower number is higher priority, no
default). Also defines fixity
to specify the relationship between the
operator and its operand(s) (no default).
A pretty-printer implemented using the continuation-based approach from Section 3.3 of Swierstra, S., and Chitil, O.
A pretty-printer implemented using the continuation-based approach from Section 3.3 of Swierstra, S., and Chitil, O. Linear, bounded, functional pretty-printing. Journal of Functional Programming 19, 01 (2008), 1–16.
defaultIndent
specifies the indentation to use if none is specified in
uses of the nest
method (default: 4). defaultWidth
specifies the
default output width (default: 75).
The interface of a pretty printer using combinators from Swierstra and Chitil (Linear, bounded, functional pretty-printing, Journal of Functional Programming, 19 (1), 2009) and Leijen's PPrint library.
The interface of a pretty printer using combinators from Swierstra and Chitil (Linear, bounded, functional pretty-printing, Journal of Functional Programming, 19 (1), 2009) and Leijen's PPrint library. The latter is a version of Wadler's library which was inspired by an earlier library by Hughes.
Unary expressions that are to be pretty-printed.
Unary expressions that are to be pretty-printed. exp
gives the operand
expressions and op
the string that is to be used as the output of the
operator.
The sides that an expression may appear on inside another expression or associativities that infix operators can have.
A collection of useful string filters.
The left side or left associativitiy of an infix operator.
No side or non-associativitiy of an infix operator.
The unary operator occurs in postfix position (i.e., after its operand).
The unary operator occurs in prefix position (i.e., before its operand).
Default pretty printer.
Common type definitions for all pretty-printers.
The right side or right associativitiy of an infix operator.
A collection of useful string filters. They are particularly intended to be filters for pretty-printer output so that the output can be tailored for a restricted setting in which it will be put. E.g., a program might be pretty-printed to show in a GUI window of a particular size, or lines indented greater than a certain amount might be omitted to show an overview.