W3cubDocs

/Haskell 8

Text.PrettyPrint.HughesPJClass

Copyright (c) Lennart Augustsson 2014
License BSD-style (see the file LICENSE)
Maintainer David Terei <[email protected]>
Stability stable
Portability portable
Safe Haskell Safe
Language Haskell98

Contents

Description

Pretty printing class, simlar to Show but nicer looking.

Note that the precedence level is a Rational so there is an unlimited number of levels. This module re-exports HughesPJ.

Pretty typeclass

class Pretty a where Source

Pretty printing class. The precedence level is used in a similar way as in the Show class. Minimal complete definition is either pPrintPrec or pPrint.

Minimal complete definition

pPrintPrec | pPrint

Methods

pPrintPrec :: PrettyLevel -> Rational -> a -> Doc Source

pPrint :: a -> Doc Source

pPrintList :: PrettyLevel -> [a] -> Doc Source

Instances
Instances details
Pretty Bool
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty Char
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty Double
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty Float
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty Int
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty Integer
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty Ordering
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Pretty ()
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> () -> Doc Source

pPrint :: () -> Doc Source

pPrintList :: PrettyLevel -> [()] -> Doc Source

Pretty a => Pretty [a]
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> [a] -> Doc Source

pPrint :: [a] -> Doc Source

pPrintList :: PrettyLevel -> [[a]] -> Doc Source

Pretty a => Pretty (Maybe a)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

(Pretty a, Pretty b) => Pretty (Either a b)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

(Pretty a, Pretty b) => Pretty (a, b)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b) -> Doc Source

pPrint :: (a, b) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b)] -> Doc Source

(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c) -> Doc Source

pPrint :: (a, b, c) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b, c)] -> Doc Source

(Pretty a, Pretty b, Pretty c, Pretty d) => Pretty (a, b, c, d)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d) -> Doc Source

pPrint :: (a, b, c, d) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b, c, d)] -> Doc Source

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e) => Pretty (a, b, c, d, e)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e) -> Doc Source

pPrint :: (a, b, c, d, e) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b, c, d, e)] -> Doc Source

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f) => Pretty (a, b, c, d, e, f)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e, f) -> Doc Source

pPrint :: (a, b, c, d, e, f) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b, c, d, e, f)] -> Doc Source

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g) => Pretty (a, b, c, d, e, f, g)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e, f, g) -> Doc Source

pPrint :: (a, b, c, d, e, f, g) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b, c, d, e, f, g)] -> Doc Source

(Pretty a, Pretty b, Pretty c, Pretty d, Pretty e, Pretty f, Pretty g, Pretty h) => Pretty (a, b, c, d, e, f, g, h)
Instance details

Defined in Text.PrettyPrint.HughesPJClass

Methods

pPrintPrec :: PrettyLevel -> Rational -> (a, b, c, d, e, f, g, h) -> Doc Source

pPrint :: (a, b, c, d, e, f, g, h) -> Doc Source

pPrintList :: PrettyLevel -> [(a, b, c, d, e, f, g, h)] -> Doc Source

newtype PrettyLevel Source

Level of detail in the pretty printed output. Level 0 is the least detail.

Constructors

PrettyLevel Int

prettyNormal :: PrettyLevel Source

The "normal" (Level 0) of detail.

prettyShow :: Pretty a => a -> String Source

Pretty print a value with the prettyNormal level.

prettyParen :: Bool -> Doc -> Doc Source

Deprecated: Please use maybeParens instead

Parenthesize an value if the boolean is true.

module Text.PrettyPrint.HughesPJ

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.8.3/docs/html/libraries/pretty-1.1.3.6/Text-PrettyPrint-HughesPJClass.html