futhark-0.15.5: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Futhark.Util.Pretty

Description

A re-export of the prettyprinting library, along with some convenience functions.

Synopsis

Documentation

data Doc #

Instances

Instances details
IsString Doc 
Instance details

Defined in Text.PrettyPrint.Mainland

Methods

fromString :: String -> Doc #

Semigroup Doc 
Instance details

Defined in Text.PrettyPrint.Mainland

Methods

(<>) :: Doc -> Doc -> Doc #

sconcat :: NonEmpty Doc -> Doc #

stimes :: Integral b => b -> Doc -> Doc #

Monoid Doc 
Instance details

Defined in Text.PrettyPrint.Mainland

Methods

mempty :: Doc #

mappend :: Doc -> Doc -> Doc #

mconcat :: [Doc] -> Doc #

Pretty Doc 
Instance details

Defined in Text.PrettyPrint.Mainland.Class

Methods

ppr :: Doc -> Doc

pprPrec :: Int -> Doc -> Doc

pprList :: [Doc] -> Doc

parens :: Doc -> Doc #

folddoc :: (Doc -> Doc -> Doc) -> [Doc] -> Doc #

(<+>) :: Doc -> Doc -> Doc #

(<+/>) :: Doc -> Doc -> Doc #

(</>) :: Doc -> Doc -> Doc #

dot :: Doc #

punctuate :: Doc -> [Doc] -> [Doc] #

(<//>) :: Doc -> Doc -> Doc #

(<|>) :: Doc -> Doc -> Doc #

align :: Doc -> Doc #

angles :: Doc -> Doc #

bool :: Bool -> Doc #

braces :: Doc -> Doc #

cat :: [Doc] -> Doc #

char :: Char -> Doc #

column :: (Int -> Doc) -> Doc #

commasep :: [Doc] -> Doc #

enclose :: Doc -> Doc -> Doc -> Doc #

enclosesep :: Doc -> Doc -> Doc -> [Doc] -> Doc #

errordoc :: Doc -> a #

faildoc :: MonadFail m => Doc -> m a #

fill :: Int -> Doc -> Doc #

fillbreak :: Int -> Doc -> Doc #

group :: Doc -> Doc #

hPutDoc :: Handle -> Doc -> IO () #

hPutDocLn :: Handle -> Doc -> IO () #

hang :: Int -> Doc -> Doc #

indent :: Int -> Doc -> Doc #

int :: Int -> Doc #

list :: [Doc] -> Doc #

nest :: Int -> Doc -> Doc #

nesting :: (Int -> Doc) -> Doc #

parensIf :: Bool -> Doc -> Doc #

prettyS :: Int -> Doc -> ShowS #

putDoc :: Doc -> IO () #

putDocLn :: Doc -> IO () #

render :: Int -> Doc -> RDoc #

semisep :: [Doc] -> Doc #

sep :: [Doc] -> Doc #

spaces :: Int -> Doc #

spread :: [Doc] -> Doc #

srcloc :: Located a => a -> Doc #

stack :: [Doc] -> Doc #

tuple :: [Doc] -> Doc #

width :: Doc -> (Int -> Doc) -> Doc #

pretty :: Pretty a => a -> String Source #

Prettyprint a value, wrapped to 80 characters.

prettyDoc :: Int -> Doc -> String Source #

Re-export of pretty.

prettyTuple :: Pretty a => [a] -> String Source #

Prettyprint a list enclosed in curly braces.

prettyText :: Pretty a => a -> Text Source #

Prettyprint a value to a Text, wrapped to 80 characters.

prettyOneLine :: Pretty a => a -> String Source #

Prettyprint a value without any width restriction.

apply :: [Doc] -> Doc Source #

The document apply ds separates ds with commas and encloses them with parentheses.

oneLine :: Doc -> Doc Source #

Make sure that the given document is printed on just a single line.

annot :: [Doc] -> Doc -> Doc Source #

Stack and prepend a list of Docs to another Doc, separated by a linebreak. If the list is empty, the second Doc will be returned without a preceding linebreak.

nestedBlock :: String -> String -> Doc -> Doc Source #

Surround the given document with enclosers and add linebreaks and indents.

textwrap :: String -> Doc Source #

Like text, but splits the string into words and permits line breaks between all of them.

shorten :: Pretty a => a -> Doc Source #

Prettyprint on a single line up to at most some appropriate number of characters, with trailing ... if necessary. Used for error messages.

color :: [SGR] -> String -> String Source #