shady-gen-0.5.1: Functional GPU programming - DSEL & compiler

Stabilityexperimental
Maintainerconal@conal.net

Text.PrettyPrint.Leijen.PrettyPrec

Contents

Description

Pretty class with precedence

Synopsis

Documentation

class Pretty a => PrettyPrec a whereSource

Pretty printing with precedence. A cross between Show and Pretty. The prettyPrec method defaults to discarding the context precedence and invoking pretty. The reason PrettyPrec derives from Pretty is that so that this default is possible.

To make a Show instance for a PrettyPrec instance Foo, define

instance Show Foo where showsPrec p e = showsPrec p (prettyPrec p e)

Methods

prettyPrec :: Int -> a -> DocSource

Show helpers

showsPretty :: Pretty a => Int -> a -> ShowSSource

Convenient definition for showsPrec in a Show instance. Uses ribbon fraction of 0.9 and width of 80. To set these values, use showsPretty' instead. If you want to take precedence into account, use showsPrettyPrec instead.

showsPretty' :: Pretty a => Float -> Int -> Int -> a -> ShowSSource

Convenient definition for showsPrec in a Show instance. Arguments are ribbon fraction and line width. To get my defaults, use showsPretty instead. Ignores precedence, which Pretty doesn't understand. If you have a PrettyPrec instance, you can use showsPrettyPrec instead.

showsPrettyPrec :: PrettyPrec a => Int -> a -> ShowSSource

Convenient definition for showsPrec in a Show instance. Uses ribbon fraction of 0.9 and width of 80. To set these values, use showsPrettyPrec' instead. See also showsPretty.

showsPrettyPrec' :: PrettyPrec a => Float -> Int -> Int -> a -> ShowSSource

Convenient definition for showsPrec in a Show instance. Arguments are ribbon fraction and line width. To get my defaults, use showsPrettyPretty instead.