tamarin-prover-utils-0.8.5.1: Utility library for the tamarin prover.

MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellSafe-Inferred

Text.PrettyPrint.Class

Contents

Description

Document class allowing to have different interpretations of the HughesPJ pretty-printing combinators.

Synopsis

Documentation

data Doc

Instances

Show Doc 
Show Doc 
IsString Doc 
Monoid Doc 
NFData Doc 
Document Doc 
HighlightDocument Doc 

class (Monoid d, NFData d) => Document d whereSource

Methods

char :: Char -> dSource

text :: String -> dSource

zeroWidthText :: String -> dSource

(<->) :: d -> d -> dSource

hcat :: [d] -> dSource

hsep :: [d] -> dSource

($$) :: d -> d -> dSource

($-$) :: d -> d -> dSource

vcat :: [d] -> dSource

sep :: [d] -> dSource

cat :: [d] -> dSource

fsep :: [d] -> dSource

fcat :: [d] -> dSource

nest :: Int -> d -> dSource

caseEmptyDoc :: d -> d -> d -> dSource

Instances

isEmpty :: Doc -> Bool

render :: Doc -> String

renderStyle :: Style -> Doc -> String

data Style

Constructors

Style 

Fields

mode :: Mode
 
lineLength :: Int
 
ribbonsPerLine :: Float
 

($--$) :: Document d => d -> d -> dSource

Vertical concatentation of two documents with an empty line in between.

emptyDoc :: Document d => dSource

The empty document.

(<>) :: Monoid m => m -> m -> m

int :: Document d => Int -> dSource

integer :: Document d => Integer -> dSource

float :: Document d => Float -> dSource

double :: Document d => Double -> dSource

rational :: Document d => Rational -> dSource

quotes :: Document d => d -> dSource

parens :: Document d => d -> dSource

brackets :: Document d => d -> dSource

braces :: Document d => d -> dSource

hang :: Document d => d -> Int -> d -> dSource

punctuate :: Document d => d -> [d] -> [d]Source

Additional combinators

nestBetweenSource

Arguments

:: Document d 
=> Int

Indent of body

-> d

Leading document

-> d

Finishing document

-> d

Body document

-> d 

Nest a document surrounded by a leading and a finishing document breaking lead, body, and finish onto separate lines, if they don't fit on a single line.

nestShortSource

Arguments

:: Document d 
=> Int

Indent of body

-> d

Leading document

-> d

Finishing document

-> d

Body document

-> d 

Nest a document surrounded by a leading and a finishing document with an non-compulsory break between lead and body.

nestShort' :: Document d => String -> String -> d -> dSource

Nest document between two strings and indent body by length lead + 1.

nestShortNonEmpty :: Document d => Int -> d -> d -> d -> dSource

Like nestShort but doesn't print the lead and finish, if the document is empty.

nestShortNonEmpty' :: Document d => String -> String -> d -> dSource

Like nestShort' but doesn't print the lead and finish, if the document is empty.

fixedWidthText :: Document d => Int -> String -> dSource

Output text with a fixed width: if it is smaller then nothing happens, otherwise care is taken to make the text appear having the given width.

symbol :: Document d => String -> dSource

Print string as symbol having width 1.

numbered :: Document d => d -> [d] -> dSource

Number a list of documents that are vertically separated by the given separator.

numbered' :: Document d => [d] -> dSource

Number a list of documents with numbers terminated by . and vertically separate using an empty line.